Text Compare
Produced: 7/19/2015 1:58:53 PM
   
Mode:  All, With Context  
Left file: C:\mksong\workspace_genproglase\genproglase-output-r1658\template09\0718-1345\valgrind-bug-12474-12473\sanity\drd\drd_load_store.c  
Right file: C:\mksong\workspace_genproglase\genproglase-output-r1658\template09\0718-1345\valgrind-bug-12474-12473\000000\drd\drd_load_store.c  
1 typedef unsigned char UChar; = 1 typedef unsigned char UChar;
2 typedef signed char Char;   2 typedef signed char Char;
3 typedef char HChar;   3 typedef char HChar;
4 typedef unsigned short UShort;   4 typedef unsigned short UShort;
5 typedef short Short;   5 typedef short Short;
6 typedef unsigned int UInt;   6 typedef unsigned int UInt;
7 typedef int Int;   7 typedef int Int;
8 typedef unsigned long long ULong;   8 typedef unsigned long long ULong;
9 typedef long long Long;   9 typedef long long Long;
10 typedef UInt U128[4];   10 typedef UInt U128[4];
11 union __anonunion_V128_1 {   11 union __anonunion_V128_1 {
12    UChar w8[16] ;   12    UChar w8[16] ;
13    UShort w16[8] ;   13    UShort w16[8] ;
14    UInt w32[4] ;   14    UInt w32[4] ;
15    ULong w64[2] ;   15    ULong w64[2] ;
16 };   16 };
17 typedef union __anonunion_V128_1 V128;   17 typedef union __anonunion_V128_1 V128;
18 typedef float Float;   18 typedef float Float;
19 typedef double Double;   19 typedef double Double;
20 typedef unsigned char Bool;   20 typedef unsigned char Bool;
21 typedef UInt Addr32;   21 typedef UInt Addr32;
22 typedef ULong Addr64;   22 typedef ULong Addr64;
23 typedef unsigned long HWord;   23 typedef unsigned long HWord;
24 typedef __builtin_va_list __gnuc_va_list;   24 typedef __builtin_va_list __gnuc_va_list;
25 typedef __gnuc_va_list va_list;   25 typedef __gnuc_va_list va_list;
26 typedef unsigned long UWord;   26 typedef unsigned long UWord;
27 typedef long Word;   27 typedef long Word;
28 typedef UWord Addr;   28 typedef UWord Addr;
29 typedef UWord AddrH;   29 typedef UWord AddrH;
30 typedef UWord SizeT;   30 typedef UWord SizeT;
31 typedef Word SSizeT;   31 typedef Word SSizeT;
32 typedef Word PtrdiffT;   32 typedef Word PtrdiffT;
33 typedef Word OffT;   33 typedef Word OffT;
34 typedef Long Off64T;   34 typedef Long Off64T;
35 struct __anonstruct_UWordPair_2 {   35 struct __anonstruct_UWordPair_2 {
36    UWord uw1 ;   36    UWord uw1 ;
37    UWord uw2 ;   37    UWord uw2 ;
38 };   38 };
39 typedef struct __anonstruct_UWordPair_2 UWordPair;   39 typedef struct __anonstruct_UWordPair_2 UWordPair;
40 typedef UInt ThreadId;   40 typedef UInt ThreadId;
41 struct __anonstruct_SysRes_3 {   41 struct __anonstruct_SysRes_3 {
42    UWord _val ;   42    UWord _val ;
43    Bool _isError ;   43    Bool _isError ;
44 };   44 };
45 typedef struct __anonstruct_SysRes_3 SysRes;   45 typedef struct __anonstruct_SysRes_3 SysRes;
46 typedef UInt DrdThreadId;   46 typedef UInt DrdThreadId;
47 struct _OSet;   47 struct _OSet;
48 typedef struct _OSet OSet;   48 typedef struct _OSet OSet;
49 typedef Word (*OSetCmp_t)(void const   *key , void const   *elem );   49 typedef Word (*OSetCmp_t)(void const   *key , void const   *elem );
50 typedef void *(*OSetAlloc_t)(HChar *cc , SizeT szB );   50 typedef void *(*OSetAlloc_t)(HChar *cc , SizeT szB );
51 typedef void (*OSetFree_t)(void *p );   51 typedef void (*OSetFree_t)(void *p );
52 struct bitmap;   52 struct bitmap;
53 struct bitmap;   53 struct bitmap;
54 enum __anonenum_BmAccessTypeT_4 {   54 enum __anonenum_BmAccessTypeT_4 {
55     eLoad = 0,   55     eLoad = 0,
56     eStore = 1,   56     eStore = 1,
57     eStart = 2,   57     eStart = 2,
58     eEnd = 3   58     eEnd = 3
59 } ;   59 } ;
60 typedef enum __anonenum_BmAccessTypeT_4 BmAccessTypeT;   60 typedef enum __anonenum_BmAccessTypeT_4 BmAccessTypeT;
61 struct bitmap2;   61 struct bitmap2;
62 struct bm_cache_elem {   62 struct bm_cache_elem {
63    Addr a1 ;   63    Addr a1 ;
64    struct bitmap2 *bm2 ;   64    struct bitmap2 *bm2 ;
65 };   65 };
66 struct bitmap {   66 struct bitmap {
67    struct bm_cache_elem cache[4] ;   67    struct bm_cache_elem cache[4] ;
68    OSet *oset ;   68    OSet *oset ;
69 };   69 };
70 struct bitmap1 {   70 struct bitmap1 {
71    UWord bm0_r[1U << 7] ;   71    UWord bm0_r[1U << 7] ;
72    UWord bm0_w[1U << 7] ;   72    UWord bm0_w[1U << 7] ;
73 };   73 };
74 struct bitmap2 {   74 struct bitmap2 {
75    Addr addr ;   75    Addr addr ;
76    Bool recalc ;   76    Bool recalc ;
77    struct bitmap1 bm1 ;   77    struct bitmap1 bm1 ;
78 };   78 };
79 struct __anonstruct_VCElem_5 {   79 struct __anonstruct_VCElem_5 {
80    DrdThreadId threadid ;   80    DrdThreadId threadid ;
81    UInt count ;   81    UInt count ;
82 };   82 };
83 typedef struct __anonstruct_VCElem_5 VCElem;   83 typedef struct __anonstruct_VCElem_5 VCElem;
84 struct __anonstruct_VectorClock_6 {   84 struct __anonstruct_VectorClock_6 {
85    unsigned int capacity ;   85    unsigned int capacity ;
86    unsigned int size ;   86    unsigned int size ;
87    VCElem *vc ;   87    VCElem *vc ;
88    VCElem preallocated[8] ;   88    VCElem preallocated[8] ;
89 };   89 };
90 typedef struct __anonstruct_VectorClock_6 VectorClock;   90 typedef struct __anonstruct_VectorClock_6 VectorClock;
91 struct _ExeContext;   91 struct _ExeContext;
92 typedef struct _ExeContext ExeContext;   92 typedef struct _ExeContext ExeContext;
93 enum __anonenum_VgRes_7 {   93 enum __anonenum_VgRes_7 {
94     Vg_LowRes = 0,   94     Vg_LowRes = 0,
95     Vg_MedRes = 1,   95     Vg_MedRes = 1,
96     Vg_HighRes = 2   96     Vg_HighRes = 2
97 } ;   97 } ;
98 typedef enum __anonenum_VgRes_7 VgRes;   98 typedef enum __anonenum_VgRes_7 VgRes;
99 typedef Addr *StackTrace;   99 typedef Addr *StackTrace;
100 struct segment {   100 struct segment {
101    struct segment *g_next ;   101    struct segment *g_next ;
102    struct segment *g_prev ;   102    struct segment *g_prev ;
103    struct segment *thr_next ;   103    struct segment *thr_next ;
104    struct segment *thr_prev ;   104    struct segment *thr_prev ;
105    DrdThreadId tid ;   105    DrdThreadId tid ;
106    int refcnt ;   106    int refcnt ;
107    ExeContext *stacktrace ;   107    ExeContext *stacktrace ;
108    VectorClock vc ;   108    VectorClock vc ;
109    struct bitmap bm ;   109    struct bitmap bm ;
110 };   110 };
111 typedef struct segment Segment;   111 typedef struct segment Segment;
112 typedef UWord PThreadId;   112 typedef UWord PThreadId;
113 struct __anonstruct_ThreadInfo_8 {   113 struct __anonstruct_ThreadInfo_8 {
114    struct segment *sg_first ;   114    struct segment *sg_first ;
115    struct segment *sg_last ;   115    struct segment *sg_last ;
116    ThreadId vg_threadid ;   116    ThreadId vg_threadid ;
117    PThreadId pt_threadid ;   117    PThreadId pt_threadid ;
118    Addr stack_min_min ;   118    Addr stack_min_min ;
119    Addr stack_min ;   119    Addr stack_min ;
120    Addr stack_startup ;   120    Addr stack_startup ;
121    Addr stack_max ;   121    Addr stack_max ;
122    SizeT stack_size ;   122    SizeT stack_size ;
123    char name[64] ;   123    char name[64] ;
124    Bool on_alt_stack ;   124    Bool on_alt_stack ;
125    Bool valid ;   125    Bool valid ;
126    Bool vg_thread_exists ;   126    Bool vg_thread_exists ;
127    Bool posix_thread_exists ;   127    Bool posix_thread_exists ;
128    Bool detached_posix_thread ;   128    Bool detached_posix_thread ;
129    Bool is_recording_loads ;   129    Bool is_recording_loads ;
130    Bool is_recording_stores ;   130    Bool is_recording_stores ;
131    Int pthread_create_nesting_level ;   131    Int pthread_create_nesting_level ;
132    Int synchr_nesting ;   132    Int synchr_nesting ;
133    unsigned int deletion_seq ;   133    unsigned int deletion_seq ;
134 };   134 };
135 typedef struct __anonstruct_ThreadInfo_8 ThreadInfo;   135 typedef struct __anonstruct_ThreadInfo_8 ThreadInfo;
136 enum __anonenum_Vg_FnNameKind_9 {   136 enum __anonenum_Vg_FnNameKind_9 {
137     Vg_FnNameNormal = 0,   137     Vg_FnNameNormal = 0,
138     Vg_FnNameMain = 1,   138     Vg_FnNameMain = 1,
139     Vg_FnNameBelowMain = 2   139     Vg_FnNameBelowMain = 2
140 } ;   140 } ;
141 typedef enum __anonenum_Vg_FnNameKind_9 Vg_FnNameKind;   141 typedef enum __anonenum_Vg_FnNameKind_9 Vg_FnNameKind;
142 struct __anonstruct_StackBlock_10 {   142 struct __anonstruct_StackBlock_10 {
143    PtrdiffT base ;   143    PtrdiffT base ;
144    SizeT szB ;   144    SizeT szB ;
145    Bool spRel ;   145    Bool spRel ;
146    Bool isVec ;   146    Bool isVec ;
147    HChar name[16] ;   147    HChar name[16] ;
148 };   148 };
149 typedef struct __anonstruct_StackBlock_10 StackBlock;   149 typedef struct __anonstruct_StackBlock_10 StackBlock;
150 struct __anonstruct_GlobalBlock_11 {   150 struct __anonstruct_GlobalBlock_11 {
151    Addr addr ;   151    Addr addr ;
152    SizeT szB ;   152    SizeT szB ;
153    Bool isVec ;   153    Bool isVec ;
154    HChar name[16] ;   154    HChar name[16] ;
155    HChar soname[16] ;   155    HChar soname[16] ;
156 };   156 };
157 typedef struct __anonstruct_GlobalBlock_11 GlobalBlock;   157 typedef struct __anonstruct_GlobalBlock_11 GlobalBlock;
158 struct _DebugInfo;   158 struct _DebugInfo;
159 typedef struct _DebugInfo DebugInfo;   159 typedef struct _DebugInfo DebugInfo;
160 enum __anonenum_VgSectKind_12 {   160 enum __anonenum_VgSectKind_12 {
161     Vg_SectUnknown = 0,   161     Vg_SectUnknown = 0,
162     Vg_SectText = 1,   162     Vg_SectText = 1,
163     Vg_SectData = 2,   163     Vg_SectData = 2,
164     Vg_SectBSS = 3,   164     Vg_SectBSS = 3,
165     Vg_SectGOT = 4,   165     Vg_SectGOT = 4,
166     Vg_SectPLT = 5,   166     Vg_SectPLT = 5,
167     Vg_SectGOTPLT = 6,   167     Vg_SectGOTPLT = 6,
168     Vg_SectOPD = 7   168     Vg_SectOPD = 7
169 } ;   169 } ;
170 typedef enum __anonenum_VgSectKind_12 VgSectKind;   170 typedef enum __anonenum_VgSectKind_12 VgSectKind;
171 typedef Int ErrorKind;   171 typedef Int ErrorKind;
172 struct _Error;   172 struct _Error;
173 typedef struct _Error Error;   173 typedef struct _Error Error;
174 typedef Int SuppKind;   174 typedef Int SuppKind;
175 struct _Supp;   175 struct _Supp;
176 typedef struct _Supp Supp;   176 typedef struct _Supp Supp;
177 enum __anonenum_DrdErrorKind_13 {   177 enum __anonenum_DrdErrorKind_13 {
178     DataRaceErr = 1,   178     DataRaceErr = 1,
179     MutexErr = 2,   179     MutexErr = 2,
180     CondErr = 3,   180     CondErr = 3,
181     CondDestrErr = 4,   181     CondDestrErr = 4,
182     CondRaceErr = 5,   182     CondRaceErr = 5,
183     CondWaitErr = 6,   183     CondWaitErr = 6,
184     SemaphoreErr = 7,   184     SemaphoreErr = 7,
185     BarrierErr = 8,   185     BarrierErr = 8,
186     RwlockErr = 9,   186     RwlockErr = 9,
187     HoldtimeErr = 10,   187     HoldtimeErr = 10,
188     GenericErr = 11,   188     GenericErr = 11,
189     InvalidThreadId = 12,   189     InvalidThreadId = 12,
190     UnimpHgClReq = 13,   190     UnimpHgClReq = 13,
191     UnimpDrdClReq = 14   191     UnimpDrdClReq = 14
192 } ;   192 } ;
193 typedef enum __anonenum_DrdErrorKind_13 DrdErrorKind;   193 typedef enum __anonenum_DrdErrorKind_13 DrdErrorKind;
194 enum __anonenum_AddrKind_14 {   194 enum __anonenum_AddrKind_14 {
195     eStack = 0,   195     eStack = 0,
196     eUnknown = 1,   196     eUnknown = 1,
197     eMallocd = 2,   197     eMallocd = 2,
198     eSegment = 3   198     eSegment = 3
199 } ;   199 } ;
200 typedef enum __anonenum_AddrKind_14 AddrKind;   200 typedef enum __anonenum_AddrKind_14 AddrKind;
201 struct __anonstruct_AddrInfo_15 {   201 struct __anonstruct_AddrInfo_15 {
202    AddrKind akind ;   202    AddrKind akind ;
203    SizeT size ;   203    SizeT size ;
204    PtrdiffT rwoffset ;   204    PtrdiffT rwoffset ;
205    ExeContext *lastchange ;   205    ExeContext *lastchange ;
206    DrdThreadId stack_tid ;   206    DrdThreadId stack_tid ;
207    DebugInfo *debuginfo ;   207    DebugInfo *debuginfo ;
208    Char name[256] ;   208    Char name[256] ;
209    Char descr[256] ;   209    Char descr[256] ;
210 };   210 };
211 typedef struct __anonstruct_AddrInfo_15 AddrInfo;   211 typedef struct __anonstruct_AddrInfo_15 AddrInfo;
212 struct __anonstruct_DataRaceErrInfo_16 {   212 struct __anonstruct_DataRaceErrInfo_16 {
213    DrdThreadId tid ;   213    DrdThreadId tid ;
214    Addr addr ;   214    Addr addr ;
215    SizeT size ;   215    SizeT size ;
216    BmAccessTypeT access_type ;   216    BmAccessTypeT access_type ;
217 };   217 };
218 typedef struct __anonstruct_DataRaceErrInfo_16 DataRaceErrInfo;   218 typedef struct __anonstruct_DataRaceErrInfo_16 DataRaceErrInfo;
219 struct __anonstruct_MutexErrInfo_17 {   219 struct __anonstruct_MutexErrInfo_17 {
220    DrdThreadId tid ;   220    DrdThreadId tid ;
221    Addr mutex ;   221    Addr mutex ;
222    Int recursion_count ;   222    Int recursion_count ;
223    DrdThreadId owner ;   223    DrdThreadId owner ;
224 };   224 };
225 typedef struct __anonstruct_MutexErrInfo_17 MutexErrInfo;   225 typedef struct __anonstruct_MutexErrInfo_17 MutexErrInfo;
226 struct __anonstruct_CondErrInfo_18 {   226 struct __anonstruct_CondErrInfo_18 {
227    DrdThreadId tid ;   227    DrdThreadId tid ;
228    Addr cond ;   228    Addr cond ;
229 };   229 };
230 typedef struct __anonstruct_CondErrInfo_18 CondErrInfo;   230 typedef struct __anonstruct_CondErrInfo_18 CondErrInfo;
231 struct __anonstruct_CondDestrErrInfo_19 {   231 struct __anonstruct_CondDestrErrInfo_19 {
232    DrdThreadId tid ;   232    DrdThreadId tid ;
233    Addr cond ;   233    Addr cond ;
234    Addr mutex ;   234    Addr mutex ;
235    DrdThreadId owner ;   235    DrdThreadId owner ;
236 };   236 };
237 typedef struct __anonstruct_CondDestrErrInfo_19 CondDestrErrInfo;   237 typedef struct __anonstruct_CondDestrErrInfo_19 CondDestrErrInfo;
238 struct __anonstruct_CondRaceErrInfo_20 {   238 struct __anonstruct_CondRaceErrInfo_20 {
239    DrdThreadId tid ;   239    DrdThreadId tid ;
240    Addr cond ;   240    Addr cond ;
241    Addr mutex ;   241    Addr mutex ;
242 };   242 };
243 typedef struct __anonstruct_CondRaceErrInfo_20 CondRaceErrInfo;   243 typedef struct __anonstruct_CondRaceErrInfo_20 CondRaceErrInfo;
244 struct __anonstruct_CondWaitErrInfo_21 {   244 struct __anonstruct_CondWaitErrInfo_21 {
245    DrdThreadId tid ;   245    DrdThreadId tid ;
246    Addr cond ;   246    Addr cond ;
247    Addr mutex1 ;   247    Addr mutex1 ;
248    Addr mutex2 ;   248    Addr mutex2 ;
249 };   249 };
250 typedef struct __anonstruct_CondWaitErrInfo_21 CondWaitErrInfo;   250 typedef struct __anonstruct_CondWaitErrInfo_21 CondWaitErrInfo;
251 struct __anonstruct_SemaphoreErrInfo_22 {   251 struct __anonstruct_SemaphoreErrInfo_22 {
252    DrdThreadId tid ;   252    DrdThreadId tid ;
253    Addr semaphore ;   253    Addr semaphore ;
254 };   254 };
255 typedef struct __anonstruct_SemaphoreErrInfo_22 SemaphoreErrInfo;   255 typedef struct __anonstruct_SemaphoreErrInfo_22 SemaphoreErrInfo;
256 struct __anonstruct_BarrierErrInfo_23 {   256 struct __anonstruct_BarrierErrInfo_23 {
257    DrdThreadId tid ;   257    DrdThreadId tid ;
258    Addr barrier ;   258    Addr barrier ;
259    DrdThreadId other_tid ;   259    DrdThreadId other_tid ;
260    ExeContext *other_context ;   260    ExeContext *other_context ;
261 };   261 };
262 typedef struct __anonstruct_BarrierErrInfo_23 BarrierErrInfo;   262 typedef struct __anonstruct_BarrierErrInfo_23 BarrierErrInfo;
263 struct __anonstruct_RwlockErrInfo_24 {   263 struct __anonstruct_RwlockErrInfo_24 {
264    DrdThreadId tid ;   264    DrdThreadId tid ;
265    Addr rwlock ;   265    Addr rwlock ;
266 };   266 };
267 typedef struct __anonstruct_RwlockErrInfo_24 RwlockErrInfo;   267 typedef struct __anonstruct_RwlockErrInfo_24 RwlockErrInfo;
268 struct __anonstruct_HoldtimeErrInfo_25 {   268 struct __anonstruct_HoldtimeErrInfo_25 {
269    DrdThreadId tid ;   269    DrdThreadId tid ;
270    Addr synchronization_object ;   270    Addr synchronization_object ;
271    ExeContext *acquired_at ;   271    ExeContext *acquired_at ;
272    UInt hold_time_ms ;   272    UInt hold_time_ms ;
273    UInt threshold_ms ;   273    UInt threshold_ms ;
274 };   274 };
275 typedef struct __anonstruct_HoldtimeErrInfo_25 HoldtimeErrInfo;   275 typedef struct __anonstruct_HoldtimeErrInfo_25 HoldtimeErrInfo;
276 struct __anonstruct_GenericErrInfo_26 {   276 struct __anonstruct_GenericErrInfo_26 {
277    DrdThreadId tid ;   277    DrdThreadId tid ;
278    Addr addr ;   278    Addr addr ;
279 };   279 };
280 typedef struct __anonstruct_GenericErrInfo_26 GenericErrInfo;   280 typedef struct __anonstruct_GenericErrInfo_26 GenericErrInfo;
281 struct __anonstruct_InvalidThreadIdInfo_27 {   281 struct __anonstruct_InvalidThreadIdInfo_27 {
282    DrdThreadId tid ;   282    DrdThreadId tid ;
283    ULong ptid ;   283    ULong ptid ;
284 };   284 };
285 typedef struct __anonstruct_InvalidThreadIdInfo_27 InvalidThreadIdInfo;   285 typedef struct __anonstruct_InvalidThreadIdInfo_27 InvalidThreadIdInfo;
286 struct __anonstruct_UnimpClReqInfo_28 {   286 struct __anonstruct_UnimpClReqInfo_28 {
287    DrdThreadId tid ;   287    DrdThreadId tid ;
288    Char *descr ;   288    Char *descr ;
289 };   289 };
290 typedef struct __anonstruct_UnimpClReqInfo_28 UnimpClReqInfo;   290 typedef struct __anonstruct_UnimpClReqInfo_28 UnimpClReqInfo;
291 enum __anonenum_VgMsgKind_29 {   291 enum __anonenum_VgMsgKind_29 {
292     Vg_FailMsg = 0,   292     Vg_FailMsg = 0,
293     Vg_UserMsg = 1,   293     Vg_UserMsg = 1,
294     Vg_DebugMsg = 2,   294     Vg_DebugMsg = 2,
295     Vg_ClientMsg = 3   295     Vg_ClientMsg = 3
296 } ;   296 } ;
297 typedef enum __anonenum_VgMsgKind_29 VgMsgKind;   297 typedef enum __anonenum_VgMsgKind_29 VgMsgKind;
298 enum __anonenum_IRType_30 {   298 enum __anonenum_IRType_30 {
299     Ity_INVALID = 69632,   299     Ity_INVALID = 69632,
300     Ity_I1 = 69633,   300     Ity_I1 = 69633,
301     Ity_I8 = 69634,   301     Ity_I8 = 69634,
302     Ity_I16 = 69635,   302     Ity_I16 = 69635,
303     Ity_I32 = 69636,   303     Ity_I32 = 69636,
304     Ity_I64 = 69637,   304     Ity_I64 = 69637,
305     Ity_I128 = 69638,   305     Ity_I128 = 69638,
306     Ity_F32 = 69639,   306     Ity_F32 = 69639,
307     Ity_F64 = 69640,   307     Ity_F64 = 69640,
308     Ity_F128 = 69641,   308     Ity_F128 = 69641,
309     Ity_V128 = 69642   309     Ity_V128 = 69642
310 } ;   310 } ;
311 typedef enum __anonenum_IRType_30 IRType;   311 typedef enum __anonenum_IRType_30 IRType;
312 enum __anonenum_IREndness_31 {   312 enum __anonenum_IREndness_31 {
313     Iend_LE = 73728,   313     Iend_LE = 73728,
314     Iend_BE = 73729   314     Iend_BE = 73729
315 } ;   315 } ;
316 typedef enum __anonenum_IREndness_31 IREndness;   316 typedef enum __anonenum_IREndness_31 IREndness;
317 enum __anonenum_IRConstTag_32 {   317 enum __anonenum_IRConstTag_32 {
318     Ico_U1 = 77824,   318     Ico_U1 = 77824,
319     Ico_U8 = 77825,   319     Ico_U8 = 77825,
320     Ico_U16 = 77826,   320     Ico_U16 = 77826,
321     Ico_U32 = 77827,   321     Ico_U32 = 77827,
322     Ico_U64 = 77828,   322     Ico_U64 = 77828,
323     Ico_F32 = 77829,   323     Ico_F32 = 77829,
324     Ico_F32i = 77830,   324     Ico_F32i = 77830,
325     Ico_F64 = 77831,   325     Ico_F64 = 77831,
326     Ico_F64i = 77832,   326     Ico_F64i = 77832,
327     Ico_V128 = 77833   327     Ico_V128 = 77833
328 } ;   328 } ;
329 typedef enum __anonenum_IRConstTag_32 IRConstTag;   329 typedef enum __anonenum_IRConstTag_32 IRConstTag;
330 union __anonunion_Ico_33 {   330 union __anonunion_Ico_33 {
331    Bool U1 ;   331    Bool U1 ;
332    UChar U8 ;   332    UChar U8 ;
333    UShort U16 ;   333    UShort U16 ;
334    UInt U32 ;   334    UInt U32 ;
335    ULong U64 ;   335    ULong U64 ;
336    Float F32 ;   336    Float F32 ;
337    UInt F32i ;   337    UInt F32i ;
338    Double F64 ;   338    Double F64 ;
339    ULong F64i ;   339    ULong F64i ;
340    UShort V128 ;   340    UShort V128 ;
341 };   341 };
342 struct _IRConst {   342 struct _IRConst {
343    IRConstTag tag ;   343    IRConstTag tag ;
344    union __anonunion_Ico_33 Ico ;   344    union __anonunion_Ico_33 Ico ;
345 };   345 };
346 typedef struct _IRConst IRConst;   346 typedef struct _IRConst IRConst;
347 struct __anonstruct_IRCallee_34 {   347 struct __anonstruct_IRCallee_34 {
348    Int regparms ;   348    Int regparms ;
349    HChar *name ;   349    HChar *name ;
350    void *addr ;   350    void *addr ;
351    UInt mcx_mask ;   351    UInt mcx_mask ;
352 };   352 };
353 typedef struct __anonstruct_IRCallee_34 IRCallee;   353 typedef struct __anonstruct_IRCallee_34 IRCallee;
354 struct __anonstruct_IRRegArray_35 {   354 struct __anonstruct_IRRegArray_35 {
355    Int base ;   355    Int base ;
356    IRType elemTy ;   356    IRType elemTy ;
357    Int nElems ;   357    Int nElems ;
358 };   358 };
359 typedef struct __anonstruct_IRRegArray_35 IRRegArray;   359 typedef struct __anonstruct_IRRegArray_35 IRRegArray;
360 typedef UInt IRTemp;   360 typedef UInt IRTemp;
361 enum __anonenum_IROp_36 {   361 enum __anonenum_IROp_36 {
362     Iop_INVALID = 81920,   362     Iop_INVALID = 81920,
363     Iop_Add8 = 81921,   363     Iop_Add8 = 81921,
364     Iop_Add16 = 81922,   364     Iop_Add16 = 81922,
365     Iop_Add32 = 81923,   365     Iop_Add32 = 81923,
366     Iop_Add64 = 81924,   366     Iop_Add64 = 81924,
367     Iop_Sub8 = 81925,   367     Iop_Sub8 = 81925,
368     Iop_Sub16 = 81926,   368     Iop_Sub16 = 81926,
369     Iop_Sub32 = 81927,   369     Iop_Sub32 = 81927,
370     Iop_Sub64 = 81928,   370     Iop_Sub64 = 81928,
371     Iop_Mul8 = 81929,   371     Iop_Mul8 = 81929,
372     Iop_Mul16 = 81930,   372     Iop_Mul16 = 81930,
373     Iop_Mul32 = 81931,   373     Iop_Mul32 = 81931,
374     Iop_Mul64 = 81932,   374     Iop_Mul64 = 81932,
375     Iop_Or8 = 81933,   375     Iop_Or8 = 81933,
376     Iop_Or16 = 81934,   376     Iop_Or16 = 81934,
377     Iop_Or32 = 81935,   377     Iop_Or32 = 81935,
378     Iop_Or64 = 81936,   378     Iop_Or64 = 81936,
379     Iop_And8 = 81937,   379     Iop_And8 = 81937,
380     Iop_And16 = 81938,   380     Iop_And16 = 81938,
381     Iop_And32 = 81939,   381     Iop_And32 = 81939,
382     Iop_And64 = 81940,   382     Iop_And64 = 81940,
383     Iop_Xor8 = 81941,   383     Iop_Xor8 = 81941,
384     Iop_Xor16 = 81942,   384     Iop_Xor16 = 81942,
385     Iop_Xor32 = 81943,   385     Iop_Xor32 = 81943,
386     Iop_Xor64 = 81944,   386     Iop_Xor64 = 81944,
387     Iop_Shl8 = 81945,   387     Iop_Shl8 = 81945,
388     Iop_Shl16 = 81946,   388     Iop_Shl16 = 81946,
389     Iop_Shl32 = 81947,   389     Iop_Shl32 = 81947,
390     Iop_Shl64 = 81948,   390     Iop_Shl64 = 81948,
391     Iop_Shr8 = 81949,   391     Iop_Shr8 = 81949,
392     Iop_Shr16 = 81950,   392     Iop_Shr16 = 81950,
393     Iop_Shr32 = 81951,   393     Iop_Shr32 = 81951,
394     Iop_Shr64 = 81952,   394     Iop_Shr64 = 81952,
395     Iop_Sar8 = 81953,   395     Iop_Sar8 = 81953,
396     Iop_Sar16 = 81954,   396     Iop_Sar16 = 81954,
397     Iop_Sar32 = 81955,   397     Iop_Sar32 = 81955,
398     Iop_Sar64 = 81956,   398     Iop_Sar64 = 81956,
399     Iop_CmpEQ8 = 81957,   399     Iop_CmpEQ8 = 81957,
400     Iop_CmpEQ16 = 81958,   400     Iop_CmpEQ16 = 81958,
401     Iop_CmpEQ32 = 81959,   401     Iop_CmpEQ32 = 81959,
402     Iop_CmpEQ64 = 81960,   402     Iop_CmpEQ64 = 81960,
403     Iop_CmpNE8 = 81961,   403     Iop_CmpNE8 = 81961,
404     Iop_CmpNE16 = 81962,   404     Iop_CmpNE16 = 81962,
405     Iop_CmpNE32 = 81963,   405     Iop_CmpNE32 = 81963,
406     Iop_CmpNE64 = 81964,   406     Iop_CmpNE64 = 81964,
407     Iop_Not8 = 81965,   407     Iop_Not8 = 81965,
408     Iop_Not16 = 81966,   408     Iop_Not16 = 81966,
409     Iop_Not32 = 81967,   409     Iop_Not32 = 81967,
410     Iop_Not64 = 81968,   410     Iop_Not64 = 81968,
411     Iop_CasCmpEQ8 = 81969,   411     Iop_CasCmpEQ8 = 81969,
412     Iop_CasCmpEQ16 = 81970,   412     Iop_CasCmpEQ16 = 81970,
413     Iop_CasCmpEQ32 = 81971,   413     Iop_CasCmpEQ32 = 81971,
414     Iop_CasCmpEQ64 = 81972,   414     Iop_CasCmpEQ64 = 81972,
415     Iop_CasCmpNE8 = 81973,   415     Iop_CasCmpNE8 = 81973,
416     Iop_CasCmpNE16 = 81974,   416     Iop_CasCmpNE16 = 81974,
417     Iop_CasCmpNE32 = 81975,   417     Iop_CasCmpNE32 = 81975,
418     Iop_CasCmpNE64 = 81976,   418     Iop_CasCmpNE64 = 81976,
419     Iop_MullS8 = 81977,   419     Iop_MullS8 = 81977,
420     Iop_MullS16 = 81978,   420     Iop_MullS16 = 81978,
421     Iop_MullS32 = 81979,   421     Iop_MullS32 = 81979,
422     Iop_MullS64 = 81980,   422     Iop_MullS64 = 81980,
423     Iop_MullU8 = 81981,   423     Iop_MullU8 = 81981,
424     Iop_MullU16 = 81982,   424     Iop_MullU16 = 81982,
425     Iop_MullU32 = 81983,   425     Iop_MullU32 = 81983,
426     Iop_MullU64 = 81984,   426     Iop_MullU64 = 81984,
427     Iop_Clz64 = 81985,   427     Iop_Clz64 = 81985,
428     Iop_Clz32 = 81986,   428     Iop_Clz32 = 81986,
429     Iop_Ctz64 = 81987,   429     Iop_Ctz64 = 81987,
430     Iop_Ctz32 = 81988,   430     Iop_Ctz32 = 81988,
431     Iop_CmpLT32S = 81989,   431     Iop_CmpLT32S = 81989,
432     Iop_CmpLT64S = 81990,   432     Iop_CmpLT64S = 81990,
433     Iop_CmpLE32S = 81991,   433     Iop_CmpLE32S = 81991,
434     Iop_CmpLE64S = 81992,   434     Iop_CmpLE64S = 81992,
435     Iop_CmpLT32U = 81993,   435     Iop_CmpLT32U = 81993,
436     Iop_CmpLT64U = 81994,   436     Iop_CmpLT64U = 81994,
437     Iop_CmpLE32U = 81995,   437     Iop_CmpLE32U = 81995,
438     Iop_CmpLE64U = 81996,   438     Iop_CmpLE64U = 81996,
439     Iop_CmpNEZ8 = 81997,   439     Iop_CmpNEZ8 = 81997,
440     Iop_CmpNEZ16 = 81998,   440     Iop_CmpNEZ16 = 81998,
441     Iop_CmpNEZ32 = 81999,   441     Iop_CmpNEZ32 = 81999,
442     Iop_CmpNEZ64 = 82000,   442     Iop_CmpNEZ64 = 82000,
443     Iop_CmpwNEZ32 = 82001,   443     Iop_CmpwNEZ32 = 82001,
444     Iop_CmpwNEZ64 = 82002,   444     Iop_CmpwNEZ64 = 82002,
445     Iop_Left8 = 82003,   445     Iop_Left8 = 82003,
446     Iop_Left16 = 82004,   446     Iop_Left16 = 82004,
447     Iop_Left32 = 82005,   447     Iop_Left32 = 82005,
448     Iop_Left64 = 82006,   448     Iop_Left64 = 82006,
449     Iop_Max32U = 82007,   449     Iop_Max32U = 82007,
450     Iop_CmpORD32U = 82008,   450     Iop_CmpORD32U = 82008,
451     Iop_CmpORD64U = 82009,   451     Iop_CmpORD64U = 82009,
452     Iop_CmpORD32S = 82010,   452     Iop_CmpORD32S = 82010,
453     Iop_CmpORD64S = 82011,   453     Iop_CmpORD64S = 82011,
454     Iop_DivU32 = 82012,   454     Iop_DivU32 = 82012,
455     Iop_DivS32 = 82013,   455     Iop_DivS32 = 82013,
456     Iop_DivU64 = 82014,   456     Iop_DivU64 = 82014,
457     Iop_DivS64 = 82015,   457     Iop_DivS64 = 82015,
458     Iop_DivU64E = 82016,   458     Iop_DivU64E = 82016,
459     Iop_DivS64E = 82017,   459     Iop_DivS64E = 82017,
460     Iop_DivU32E = 82018,   460     Iop_DivU32E = 82018,
461     Iop_DivS32E = 82019,   461     Iop_DivS32E = 82019,
462     Iop_DivModU64to32 = 82020,   462     Iop_DivModU64to32 = 82020,
463     Iop_DivModS64to32 = 82021,   463     Iop_DivModS64to32 = 82021,
464     Iop_DivModU128to64 = 82022,   464     Iop_DivModU128to64 = 82022,
465     Iop_DivModS128to64 = 82023,   465     Iop_DivModS128to64 = 82023,
466     Iop_DivModS64to64 = 82024,   466     Iop_DivModS64to64 = 82024,
467     Iop_8Uto16 = 82025,   467     Iop_8Uto16 = 82025,
468     Iop_8Uto32 = 82026,   468     Iop_8Uto32 = 82026,
469     Iop_8Uto64 = 82027,   469     Iop_8Uto64 = 82027,
470     Iop_16Uto32 = 82028,   470     Iop_16Uto32 = 82028,
471     Iop_16Uto64 = 82029,   471     Iop_16Uto64 = 82029,
472     Iop_32Uto64 = 82030,   472     Iop_32Uto64 = 82030,
473     Iop_8Sto16 = 82031,   473     Iop_8Sto16 = 82031,
474     Iop_8Sto32 = 82032,   474     Iop_8Sto32 = 82032,
475     Iop_8Sto64 = 82033,   475     Iop_8Sto64 = 82033,
476     Iop_16Sto32 = 82034,   476     Iop_16Sto32 = 82034,
477     Iop_16Sto64 = 82035,   477     Iop_16Sto64 = 82035,
478     Iop_32Sto64 = 82036,   478     Iop_32Sto64 = 82036,
479     Iop_64to8 = 82037,   479     Iop_64to8 = 82037,
480     Iop_32to8 = 82038,   480     Iop_32to8 = 82038,
481     Iop_64to16 = 82039,   481     Iop_64to16 = 82039,
482     Iop_16to8 = 82040,   482     Iop_16to8 = 82040,
483     Iop_16HIto8 = 82041,   483     Iop_16HIto8 = 82041,
484     Iop_8HLto16 = 82042,   484     Iop_8HLto16 = 82042,
485     Iop_32to16 = 82043,   485     Iop_32to16 = 82043,
486     Iop_32HIto16 = 82044,   486     Iop_32HIto16 = 82044,
487     Iop_16HLto32 = 82045,   487     Iop_16HLto32 = 82045,
488     Iop_64to32 = 82046,   488     Iop_64to32 = 82046,
489     Iop_64HIto32 = 82047,   489     Iop_64HIto32 = 82047,
490     Iop_32HLto64 = 82048,   490     Iop_32HLto64 = 82048,
491     Iop_128to64 = 82049,   491     Iop_128to64 = 82049,
492     Iop_128HIto64 = 82050,   492     Iop_128HIto64 = 82050,
493     Iop_64HLto128 = 82051,   493     Iop_64HLto128 = 82051,
494     Iop_Not1 = 82052,   494     Iop_Not1 = 82052,
495     Iop_32to1 = 82053,   495     Iop_32to1 = 82053,
496     Iop_64to1 = 82054,   496     Iop_64to1 = 82054,
497     Iop_1Uto8 = 82055,   497     Iop_1Uto8 = 82055,
498     Iop_1Uto32 = 82056,   498     Iop_1Uto32 = 82056,
499     Iop_1Uto64 = 82057,   499     Iop_1Uto64 = 82057,
500     Iop_1Sto8 = 82058,   500     Iop_1Sto8 = 82058,
501     Iop_1Sto16 = 82059,   501     Iop_1Sto16 = 82059,
502     Iop_1Sto32 = 82060,   502     Iop_1Sto32 = 82060,
503     Iop_1Sto64 = 82061,   503     Iop_1Sto64 = 82061,
504     Iop_AddF64 = 82062,   504     Iop_AddF64 = 82062,
505     Iop_SubF64 = 82063,   505     Iop_SubF64 = 82063,
506     Iop_MulF64 = 82064,   506     Iop_MulF64 = 82064,
507     Iop_DivF64 = 82065,   507     Iop_DivF64 = 82065,
508     Iop_AddF32 = 82066,   508     Iop_AddF32 = 82066,
509     Iop_SubF32 = 82067,   509     Iop_SubF32 = 82067,
510     Iop_MulF32 = 82068,   510     Iop_MulF32 = 82068,
511     Iop_DivF32 = 82069,   511     Iop_DivF32 = 82069,
512     Iop_AddF64r32 = 82070,   512     Iop_AddF64r32 = 82070,
513     Iop_SubF64r32 = 82071,   513     Iop_SubF64r32 = 82071,
514     Iop_MulF64r32 = 82072,   514     Iop_MulF64r32 = 82072,
515     Iop_DivF64r32 = 82073,   515     Iop_DivF64r32 = 82073,
516     Iop_NegF64 = 82074,   516     Iop_NegF64 = 82074,
517     Iop_AbsF64 = 82075,   517     Iop_AbsF64 = 82075,
518     Iop_NegF32 = 82076,   518     Iop_NegF32 = 82076,
519     Iop_AbsF32 = 82077,   519     Iop_AbsF32 = 82077,
520     Iop_SqrtF64 = 82078,   520     Iop_SqrtF64 = 82078,
521     Iop_SqrtF64r32 = 82079,   521     Iop_SqrtF64r32 = 82079,
522     Iop_SqrtF32 = 82080,   522     Iop_SqrtF32 = 82080,
523     Iop_CmpF64 = 82081,   523     Iop_CmpF64 = 82081,
524     Iop_CmpF32 = 82082,   524     Iop_CmpF32 = 82082,
525     Iop_CmpF128 = 82083,   525     Iop_CmpF128 = 82083,
526     Iop_F64toI16S = 82084,   526     Iop_F64toI16S = 82084,
527     Iop_F64toI32S = 82085,   527     Iop_F64toI32S = 82085,
528     Iop_F64toI64S = 82086,   528     Iop_F64toI64S = 82086,
529     Iop_F64toI64U = 82087,   529     Iop_F64toI64U = 82087,
530     Iop_F64toI32U = 82088,   530     Iop_F64toI32U = 82088,
531     Iop_I16StoF64 = 82089,   531     Iop_I16StoF64 = 82089,
532     Iop_I32StoF64 = 82090,   532     Iop_I32StoF64 = 82090,
533     Iop_I64StoF64 = 82091,   533     Iop_I64StoF64 = 82091,
534     Iop_I64UtoF64 = 82092,   534     Iop_I64UtoF64 = 82092,
535     Iop_I64UtoF32 = 82093,   535     Iop_I64UtoF32 = 82093,
536     Iop_I32UtoF64 = 82094,   536     Iop_I32UtoF64 = 82094,
537     Iop_F32toI16S = 82095,   537     Iop_F32toI16S = 82095,
538     Iop_F32toI32S = 82096,   538     Iop_F32toI32S = 82096,
539     Iop_F32toI64S = 82097,   539     Iop_F32toI64S = 82097,
540     Iop_I16StoF32 = 82098,   540     Iop_I16StoF32 = 82098,
541     Iop_I32StoF32 = 82099,   541     Iop_I32StoF32 = 82099,
542     Iop_I64StoF32 = 82100,   542     Iop_I64StoF32 = 82100,
543     Iop_F32toF64 = 82101,   543     Iop_F32toF64 = 82101,
544     Iop_F64toF32 = 82102,   544     Iop_F64toF32 = 82102,
545     Iop_ReinterpF64asI64 = 82103,   545     Iop_ReinterpF64asI64 = 82103,
546     Iop_ReinterpI64asF64 = 82104,   546     Iop_ReinterpI64asF64 = 82104,
547     Iop_ReinterpF32asI32 = 82105,   547     Iop_ReinterpF32asI32 = 82105,
548     Iop_ReinterpI32asF32 = 82106,   548     Iop_ReinterpI32asF32 = 82106,
549     Iop_F64HLtoF128 = 82107,   549     Iop_F64HLtoF128 = 82107,
550     Iop_F128HItoF64 = 82108,   550     Iop_F128HItoF64 = 82108,
551     Iop_F128LOtoF64 = 82109,   551     Iop_F128LOtoF64 = 82109,
552     Iop_AddF128 = 82110,   552     Iop_AddF128 = 82110,
553     Iop_SubF128 = 82111,   553     Iop_SubF128 = 82111,
554     Iop_MulF128 = 82112,   554     Iop_MulF128 = 82112,
555     Iop_DivF128 = 82113,   555     Iop_DivF128 = 82113,
556     Iop_NegF128 = 82114,   556     Iop_NegF128 = 82114,
557     Iop_AbsF128 = 82115,   557     Iop_AbsF128 = 82115,
558     Iop_SqrtF128 = 82116,   558     Iop_SqrtF128 = 82116,
559     Iop_I32StoF128 = 82117,   559     Iop_I32StoF128 = 82117,
560     Iop_I64StoF128 = 82118,   560     Iop_I64StoF128 = 82118,
561     Iop_F32toF128 = 82119,   561     Iop_F32toF128 = 82119,
562     Iop_F64toF128 = 82120,   562     Iop_F64toF128 = 82120,
563     Iop_F128toI32S = 82121,   563     Iop_F128toI32S = 82121,
564     Iop_F128toI64S = 82122,   564     Iop_F128toI64S = 82122,
565     Iop_F128toF64 = 82123,   565     Iop_F128toF64 = 82123,
566     Iop_F128toF32 = 82124,   566     Iop_F128toF32 = 82124,
567     Iop_AtanF64 = 82125,   567     Iop_AtanF64 = 82125,
568     Iop_Yl2xF64 = 82126,   568     Iop_Yl2xF64 = 82126,
569     Iop_Yl2xp1F64 = 82127,   569     Iop_Yl2xp1F64 = 82127,
570     Iop_PRemF64 = 82128,   570     Iop_PRemF64 = 82128,
571     Iop_PRemC3210F64 = 82129,   571     Iop_PRemC3210F64 = 82129,
572     Iop_PRem1F64 = 82130,   572     Iop_PRem1F64 = 82130,
573     Iop_PRem1C3210F64 = 82131,   573     Iop_PRem1C3210F64 = 82131,
574     Iop_ScaleF64 = 82132,   574     Iop_ScaleF64 = 82132,
575     Iop_SinF64 = 82133,   575     Iop_SinF64 = 82133,
576     Iop_CosF64 = 82134,   576     Iop_CosF64 = 82134,
577     Iop_TanF64 = 82135,   577     Iop_TanF64 = 82135,
578     Iop_2xm1F64 = 82136,   578     Iop_2xm1F64 = 82136,
579     Iop_RoundF64toInt = 82137,   579     Iop_RoundF64toInt = 82137,
580     Iop_RoundF32toInt = 82138,   580     Iop_RoundF32toInt = 82138,
581     Iop_MAddF32 = 82139,   581     Iop_MAddF32 = 82139,
582     Iop_MSubF32 = 82140,   582     Iop_MSubF32 = 82140,
583     Iop_MAddF64 = 82141,   583     Iop_MAddF64 = 82141,
584     Iop_MSubF64 = 82142,   584     Iop_MSubF64 = 82142,
585     Iop_MAddF64r32 = 82143,   585     Iop_MAddF64r32 = 82143,
586     Iop_MSubF64r32 = 82144,   586     Iop_MSubF64r32 = 82144,
587     Iop_Est5FRSqrt = 82145,   587     Iop_Est5FRSqrt = 82145,
588     Iop_RoundF64toF64_NEAREST = 82146,   588     Iop_RoundF64toF64_NEAREST = 82146,
589     Iop_RoundF64toF64_NegINF = 82147,   589     Iop_RoundF64toF64_NegINF = 82147,
590     Iop_RoundF64toF64_PosINF = 82148,   590     Iop_RoundF64toF64_PosINF = 82148,
591     Iop_RoundF64toF64_ZERO = 82149,   591     Iop_RoundF64toF64_ZERO = 82149,
592     Iop_TruncF64asF32 = 82150,   592     Iop_TruncF64asF32 = 82150,
593     Iop_RoundF64toF32 = 82151,   593     Iop_RoundF64toF32 = 82151,
594     Iop_CalcFPRF = 82152,   594     Iop_CalcFPRF = 82152,
595     Iop_Add16x2 = 82153,   595     Iop_Add16x2 = 82153,
596     Iop_Sub16x2 = 82154,   596     Iop_Sub16x2 = 82154,
597     Iop_QAdd16Sx2 = 82155,   597     Iop_QAdd16Sx2 = 82155,
598     Iop_QAdd16Ux2 = 82156,   598     Iop_QAdd16Ux2 = 82156,
599     Iop_QSub16Sx2 = 82157,   599     Iop_QSub16Sx2 = 82157,
600     Iop_QSub16Ux2 = 82158,   600     Iop_QSub16Ux2 = 82158,
601     Iop_HAdd16Ux2 = 82159,   601     Iop_HAdd16Ux2 = 82159,
602     Iop_HAdd16Sx2 = 82160,   602     Iop_HAdd16Sx2 = 82160,
603     Iop_HSub16Ux2 = 82161,   603     Iop_HSub16Ux2 = 82161,
604     Iop_HSub16Sx2 = 82162,   604     Iop_HSub16Sx2 = 82162,
605     Iop_Add8x4 = 82163,   605     Iop_Add8x4 = 82163,
606     Iop_Sub8x4 = 82164,   606     Iop_Sub8x4 = 82164,
607     Iop_QAdd8Sx4 = 82165,   607     Iop_QAdd8Sx4 = 82165,
608     Iop_QAdd8Ux4 = 82166,   608     Iop_QAdd8Ux4 = 82166,
609     Iop_QSub8Sx4 = 82167,   609     Iop_QSub8Sx4 = 82167,
610     Iop_QSub8Ux4 = 82168,   610     Iop_QSub8Ux4 = 82168,
611     Iop_HAdd8Ux4 = 82169,   611     Iop_HAdd8Ux4 = 82169,
612     Iop_HAdd8Sx4 = 82170,   612     Iop_HAdd8Sx4 = 82170,
613     Iop_HSub8Ux4 = 82171,   613     Iop_HSub8Ux4 = 82171,
614     Iop_HSub8Sx4 = 82172,   614     Iop_HSub8Sx4 = 82172,
615     Iop_Sad8Ux4 = 82173,   615     Iop_Sad8Ux4 = 82173,
616     Iop_CmpNEZ16x2 = 82174,   616     Iop_CmpNEZ16x2 = 82174,
617     Iop_CmpNEZ8x4 = 82175,   617     Iop_CmpNEZ8x4 = 82175,
618     Iop_I32UtoFx2 = 82176,   618     Iop_I32UtoFx2 = 82176,
619     Iop_I32StoFx2 = 82177,   619     Iop_I32StoFx2 = 82177,
620     Iop_FtoI32Ux2_RZ = 82178,   620     Iop_FtoI32Ux2_RZ = 82178,
621     Iop_FtoI32Sx2_RZ = 82179,   621     Iop_FtoI32Sx2_RZ = 82179,
622     Iop_F32ToFixed32Ux2_RZ = 82180,   622     Iop_F32ToFixed32Ux2_RZ = 82180,
623     Iop_F32ToFixed32Sx2_RZ = 82181,   623     Iop_F32ToFixed32Sx2_RZ = 82181,
624     Iop_Fixed32UToF32x2_RN = 82182,   624     Iop_Fixed32UToF32x2_RN = 82182,
625     Iop_Fixed32SToF32x2_RN = 82183,   625     Iop_Fixed32SToF32x2_RN = 82183,
626     Iop_Max32Fx2 = 82184,   626     Iop_Max32Fx2 = 82184,
627     Iop_Min32Fx2 = 82185,   627     Iop_Min32Fx2 = 82185,
628     Iop_PwMax32Fx2 = 82186,   628     Iop_PwMax32Fx2 = 82186,
629     Iop_PwMin32Fx2 = 82187,   629     Iop_PwMin32Fx2 = 82187,
630     Iop_CmpEQ32Fx2 = 82188,   630     Iop_CmpEQ32Fx2 = 82188,
631     Iop_CmpGT32Fx2 = 82189,   631     Iop_CmpGT32Fx2 = 82189,
632     Iop_CmpGE32Fx2 = 82190,   632     Iop_CmpGE32Fx2 = 82190,
633     Iop_Recip32Fx2 = 82191,   633     Iop_Recip32Fx2 = 82191,
634     Iop_Recps32Fx2 = 82192,   634     Iop_Recps32Fx2 = 82192,
635     Iop_Rsqrte32Fx2 = 82193,   635     Iop_Rsqrte32Fx2 = 82193,
636     Iop_Rsqrts32Fx2 = 82194,   636     Iop_Rsqrts32Fx2 = 82194,
637     Iop_Neg32Fx2 = 82195,   637     Iop_Neg32Fx2 = 82195,
638     Iop_Abs32Fx2 = 82196,   638     Iop_Abs32Fx2 = 82196,
639     Iop_CmpNEZ8x8 = 82197,   639     Iop_CmpNEZ8x8 = 82197,
640     Iop_CmpNEZ16x4 = 82198,   640     Iop_CmpNEZ16x4 = 82198,
641     Iop_CmpNEZ32x2 = 82199,   641     Iop_CmpNEZ32x2 = 82199,
642     Iop_Add8x8 = 82200,   642     Iop_Add8x8 = 82200,
643     Iop_Add16x4 = 82201,   643     Iop_Add16x4 = 82201,
644     Iop_Add32x2 = 82202,   644     Iop_Add32x2 = 82202,
645     Iop_QAdd8Ux8 = 82203,   645     Iop_QAdd8Ux8 = 82203,
646     Iop_QAdd16Ux4 = 82204,   646     Iop_QAdd16Ux4 = 82204,
647     Iop_QAdd32Ux2 = 82205,   647     Iop_QAdd32Ux2 = 82205,
648     Iop_QAdd64Ux1 = 82206,   648     Iop_QAdd64Ux1 = 82206,
649     Iop_QAdd8Sx8 = 82207,   649     Iop_QAdd8Sx8 = 82207,
650     Iop_QAdd16Sx4 = 82208,   650     Iop_QAdd16Sx4 = 82208,
651     Iop_QAdd32Sx2 = 82209,   651     Iop_QAdd32Sx2 = 82209,
652     Iop_QAdd64Sx1 = 82210,   652     Iop_QAdd64Sx1 = 82210,
653     Iop_PwAdd8x8 = 82211,   653     Iop_PwAdd8x8 = 82211,
654     Iop_PwAdd16x4 = 82212,   654     Iop_PwAdd16x4 = 82212,
655     Iop_PwAdd32x2 = 82213,   655     Iop_PwAdd32x2 = 82213,
656     Iop_PwMax8Sx8 = 82214,   656     Iop_PwMax8Sx8 = 82214,
657     Iop_PwMax16Sx4 = 82215,   657     Iop_PwMax16Sx4 = 82215,
658     Iop_PwMax32Sx2 = 82216,   658     Iop_PwMax32Sx2 = 82216,
659     Iop_PwMax8Ux8 = 82217,   659     Iop_PwMax8Ux8 = 82217,
660     Iop_PwMax16Ux4 = 82218,   660     Iop_PwMax16Ux4 = 82218,
661     Iop_PwMax32Ux2 = 82219,   661     Iop_PwMax32Ux2 = 82219,
662     Iop_PwMin8Sx8 = 82220,   662     Iop_PwMin8Sx8 = 82220,
663     Iop_PwMin16Sx4 = 82221,   663     Iop_PwMin16Sx4 = 82221,
664     Iop_PwMin32Sx2 = 82222,   664     Iop_PwMin32Sx2 = 82222,
665     Iop_PwMin8Ux8 = 82223,   665     Iop_PwMin8Ux8 = 82223,
666     Iop_PwMin16Ux4 = 82224,   666     Iop_PwMin16Ux4 = 82224,
667     Iop_PwMin32Ux2 = 82225,   667     Iop_PwMin32Ux2 = 82225,
668     Iop_PwAddL8Ux8 = 82226,   668     Iop_PwAddL8Ux8 = 82226,
669     Iop_PwAddL16Ux4 = 82227,   669     Iop_PwAddL16Ux4 = 82227,
670     Iop_PwAddL32Ux2 = 82228,   670     Iop_PwAddL32Ux2 = 82228,
671     Iop_PwAddL8Sx8 = 82229,   671     Iop_PwAddL8Sx8 = 82229,
672     Iop_PwAddL16Sx4 = 82230,   672     Iop_PwAddL16Sx4 = 82230,
673     Iop_PwAddL32Sx2 = 82231,   673     Iop_PwAddL32Sx2 = 82231,
674     Iop_Sub8x8 = 82232,   674     Iop_Sub8x8 = 82232,
675     Iop_Sub16x4 = 82233,   675     Iop_Sub16x4 = 82233,
676     Iop_Sub32x2 = 82234,   676     Iop_Sub32x2 = 82234,
677     Iop_QSub8Ux8 = 82235,   677     Iop_QSub8Ux8 = 82235,
678     Iop_QSub16Ux4 = 82236,   678     Iop_QSub16Ux4 = 82236,
679     Iop_QSub32Ux2 = 82237,   679     Iop_QSub32Ux2 = 82237,
680     Iop_QSub64Ux1 = 82238,   680     Iop_QSub64Ux1 = 82238,
681     Iop_QSub8Sx8 = 82239,   681     Iop_QSub8Sx8 = 82239,
682     Iop_QSub16Sx4 = 82240,   682     Iop_QSub16Sx4 = 82240,
683     Iop_QSub32Sx2 = 82241,   683     Iop_QSub32Sx2 = 82241,
684     Iop_QSub64Sx1 = 82242,   684     Iop_QSub64Sx1 = 82242,
685     Iop_Abs8x8 = 82243,   685     Iop_Abs8x8 = 82243,
686     Iop_Abs16x4 = 82244,   686     Iop_Abs16x4 = 82244,
687     Iop_Abs32x2 = 82245,   687     Iop_Abs32x2 = 82245,
688     Iop_Mul8x8 = 82246,   688     Iop_Mul8x8 = 82246,
689     Iop_Mul16x4 = 82247,   689     Iop_Mul16x4 = 82247,
690     Iop_Mul32x2 = 82248,   690     Iop_Mul32x2 = 82248,
691     Iop_Mul32Fx2 = 82249,   691     Iop_Mul32Fx2 = 82249,
692     Iop_MulHi16Ux4 = 82250,   692     Iop_MulHi16Ux4 = 82250,
693     Iop_MulHi16Sx4 = 82251,   693     Iop_MulHi16Sx4 = 82251,
694     Iop_PolynomialMul8x8 = 82252,   694     Iop_PolynomialMul8x8 = 82252,
695     Iop_QDMulHi16Sx4 = 82253,   695     Iop_QDMulHi16Sx4 = 82253,
696     Iop_QDMulHi32Sx2 = 82254,   696     Iop_QDMulHi32Sx2 = 82254,
697     Iop_QRDMulHi16Sx4 = 82255,   697     Iop_QRDMulHi16Sx4 = 82255,
698     Iop_QRDMulHi32Sx2 = 82256,   698     Iop_QRDMulHi32Sx2 = 82256,
699     Iop_Avg8Ux8 = 82257,   699     Iop_Avg8Ux8 = 82257,
700     Iop_Avg16Ux4 = 82258,   700     Iop_Avg16Ux4 = 82258,
701     Iop_Max8Sx8 = 82259,   701     Iop_Max8Sx8 = 82259,
702     Iop_Max16Sx4 = 82260,   702     Iop_Max16Sx4 = 82260,
703     Iop_Max32Sx2 = 82261,   703     Iop_Max32Sx2 = 82261,
704     Iop_Max8Ux8 = 82262,   704     Iop_Max8Ux8 = 82262,
705     Iop_Max16Ux4 = 82263,   705     Iop_Max16Ux4 = 82263,
706     Iop_Max32Ux2 = 82264,   706     Iop_Max32Ux2 = 82264,
707     Iop_Min8Sx8 = 82265,   707     Iop_Min8Sx8 = 82265,
708     Iop_Min16Sx4 = 82266,   708     Iop_Min16Sx4 = 82266,
709     Iop_Min32Sx2 = 82267,   709     Iop_Min32Sx2 = 82267,
710     Iop_Min8Ux8 = 82268,   710     Iop_Min8Ux8 = 82268,
711     Iop_Min16Ux4 = 82269,   711     Iop_Min16Ux4 = 82269,
712     Iop_Min32Ux2 = 82270,   712     Iop_Min32Ux2 = 82270,
713     Iop_CmpEQ8x8 = 82271,   713     Iop_CmpEQ8x8 = 82271,
714     Iop_CmpEQ16x4 = 82272,   714     Iop_CmpEQ16x4 = 82272,
715     Iop_CmpEQ32x2 = 82273,   715     Iop_CmpEQ32x2 = 82273,
716     Iop_CmpGT8Ux8 = 82274,   716     Iop_CmpGT8Ux8 = 82274,
717     Iop_CmpGT16Ux4 = 82275,   717     Iop_CmpGT16Ux4 = 82275,
718     Iop_CmpGT32Ux2 = 82276,   718     Iop_CmpGT32Ux2 = 82276,
719     Iop_CmpGT8Sx8 = 82277,   719     Iop_CmpGT8Sx8 = 82277,
720     Iop_CmpGT16Sx4 = 82278,   720     Iop_CmpGT16Sx4 = 82278,
721     Iop_CmpGT32Sx2 = 82279,   721     Iop_CmpGT32Sx2 = 82279,
722     Iop_Cnt8x8 = 82280,   722     Iop_Cnt8x8 = 82280,
723     Iop_Clz8Sx8 = 82281,   723     Iop_Clz8Sx8 = 82281,
724     Iop_Clz16Sx4 = 82282,   724     Iop_Clz16Sx4 = 82282,
725     Iop_Clz32Sx2 = 82283,   725     Iop_Clz32Sx2 = 82283,
726     Iop_Cls8Sx8 = 82284,   726     Iop_Cls8Sx8 = 82284,
727     Iop_Cls16Sx4 = 82285,   727     Iop_Cls16Sx4 = 82285,
728     Iop_Cls32Sx2 = 82286,   728     Iop_Cls32Sx2 = 82286,
729     Iop_Shl8x8 = 82287,   729     Iop_Shl8x8 = 82287,
730     Iop_Shl16x4 = 82288,   730     Iop_Shl16x4 = 82288,
731     Iop_Shl32x2 = 82289,   731     Iop_Shl32x2 = 82289,
732     Iop_Shr8x8 = 82290,   732     Iop_Shr8x8 = 82290,
733     Iop_Shr16x4 = 82291,   733     Iop_Shr16x4 = 82291,
734     Iop_Shr32x2 = 82292,   734     Iop_Shr32x2 = 82292,
735     Iop_Sar8x8 = 82293,   735     Iop_Sar8x8 = 82293,
736     Iop_Sar16x4 = 82294,   736     Iop_Sar16x4 = 82294,
737     Iop_Sar32x2 = 82295,   737     Iop_Sar32x2 = 82295,
738     Iop_Sal8x8 = 82296,   738     Iop_Sal8x8 = 82296,
739     Iop_Sal16x4 = 82297,   739     Iop_Sal16x4 = 82297,
740     Iop_Sal32x2 = 82298,   740     Iop_Sal32x2 = 82298,
741     Iop_Sal64x1 = 82299,   741     Iop_Sal64x1 = 82299,
742     Iop_ShlN8x8 = 82300,   742     Iop_ShlN8x8 = 82300,
743     Iop_ShlN16x4 = 82301,   743     Iop_ShlN16x4 = 82301,
744     Iop_ShlN32x2 = 82302,   744     Iop_ShlN32x2 = 82302,
745     Iop_ShrN8x8 = 82303,   745     Iop_ShrN8x8 = 82303,
746     Iop_ShrN16x4 = 82304,   746     Iop_ShrN16x4 = 82304,
747     Iop_ShrN32x2 = 82305,   747     Iop_ShrN32x2 = 82305,
748     Iop_SarN8x8 = 82306,   748     Iop_SarN8x8 = 82306,
749     Iop_SarN16x4 = 82307,   749     Iop_SarN16x4 = 82307,
750     Iop_SarN32x2 = 82308,   750     Iop_SarN32x2 = 82308,
751     Iop_QShl8x8 = 82309,   751     Iop_QShl8x8 = 82309,
752     Iop_QShl16x4 = 82310,   752     Iop_QShl16x4 = 82310,
753     Iop_QShl32x2 = 82311,   753     Iop_QShl32x2 = 82311,
754     Iop_QShl64x1 = 82312,   754     Iop_QShl64x1 = 82312,
755     Iop_QSal8x8 = 82313,   755     Iop_QSal8x8 = 82313,
756     Iop_QSal16x4 = 82314,   756     Iop_QSal16x4 = 82314,
757     Iop_QSal32x2 = 82315,   757     Iop_QSal32x2 = 82315,
758     Iop_QSal64x1 = 82316,   758     Iop_QSal64x1 = 82316,
759     Iop_QShlN8Sx8 = 82317,   759     Iop_QShlN8Sx8 = 82317,
760     Iop_QShlN16Sx4 = 82318,   760     Iop_QShlN16Sx4 = 82318,
761     Iop_QShlN32Sx2 = 82319,   761     Iop_QShlN32Sx2 = 82319,
762     Iop_QShlN64Sx1 = 82320,   762     Iop_QShlN64Sx1 = 82320,
763     Iop_QShlN8x8 = 82321,   763     Iop_QShlN8x8 = 82321,
764     Iop_QShlN16x4 = 82322,   764     Iop_QShlN16x4 = 82322,
765     Iop_QShlN32x2 = 82323,   765     Iop_QShlN32x2 = 82323,
766     Iop_QShlN64x1 = 82324,   766     Iop_QShlN64x1 = 82324,
767     Iop_QSalN8x8 = 82325,   767     Iop_QSalN8x8 = 82325,
768     Iop_QSalN16x4 = 82326,   768     Iop_QSalN16x4 = 82326,
769     Iop_QSalN32x2 = 82327,   769     Iop_QSalN32x2 = 82327,
770     Iop_QSalN64x1 = 82328,   770     Iop_QSalN64x1 = 82328,
771     Iop_QNarrowBin16Sto8Ux8 = 82329,   771     Iop_QNarrowBin16Sto8Ux8 = 82329,
772     Iop_QNarrowBin16Sto8Sx8 = 82330,   772     Iop_QNarrowBin16Sto8Sx8 = 82330,
773     Iop_QNarrowBin32Sto16Sx4 = 82331,   773     Iop_QNarrowBin32Sto16Sx4 = 82331,
774     Iop_NarrowBin16to8x8 = 82332,   774     Iop_NarrowBin16to8x8 = 82332,
775     Iop_NarrowBin32to16x4 = 82333,   775     Iop_NarrowBin32to16x4 = 82333,
776     Iop_InterleaveHI8x8 = 82334,   776     Iop_InterleaveHI8x8 = 82334,
777     Iop_InterleaveHI16x4 = 82335,   777     Iop_InterleaveHI16x4 = 82335,
778     Iop_InterleaveHI32x2 = 82336,   778     Iop_InterleaveHI32x2 = 82336,
779     Iop_InterleaveLO8x8 = 82337,   779     Iop_InterleaveLO8x8 = 82337,
780     Iop_InterleaveLO16x4 = 82338,   780     Iop_InterleaveLO16x4 = 82338,
781     Iop_InterleaveLO32x2 = 82339,   781     Iop_InterleaveLO32x2 = 82339,
782     Iop_InterleaveOddLanes8x8 = 82340,   782     Iop_InterleaveOddLanes8x8 = 82340,
783     Iop_InterleaveEvenLanes8x8 = 82341,   783     Iop_InterleaveEvenLanes8x8 = 82341,
784     Iop_InterleaveOddLanes16x4 = 82342,   784     Iop_InterleaveOddLanes16x4 = 82342,
785     Iop_InterleaveEvenLanes16x4 = 82343,   785     Iop_InterleaveEvenLanes16x4 = 82343,
786     Iop_CatOddLanes8x8 = 82344,   786     Iop_CatOddLanes8x8 = 82344,
787     Iop_CatOddLanes16x4 = 82345,   787     Iop_CatOddLanes16x4 = 82345,
788     Iop_CatEvenLanes8x8 = 82346,   788     Iop_CatEvenLanes8x8 = 82346,
789     Iop_CatEvenLanes16x4 = 82347,   789     Iop_CatEvenLanes16x4 = 82347,
790     Iop_GetElem8x8 = 82348,   790     Iop_GetElem8x8 = 82348,
791     Iop_GetElem16x4 = 82349,   791     Iop_GetElem16x4 = 82349,
792     Iop_GetElem32x2 = 82350,   792     Iop_GetElem32x2 = 82350,
793     Iop_SetElem8x8 = 82351,   793     Iop_SetElem8x8 = 82351,
794     Iop_SetElem16x4 = 82352,   794     Iop_SetElem16x4 = 82352,
795     Iop_SetElem32x2 = 82353,   795     Iop_SetElem32x2 = 82353,
796     Iop_Dup8x8 = 82354,   796     Iop_Dup8x8 = 82354,
797     Iop_Dup16x4 = 82355,   797     Iop_Dup16x4 = 82355,
798     Iop_Dup32x2 = 82356,   798     Iop_Dup32x2 = 82356,
799     Iop_Extract64 = 82357,   799     Iop_Extract64 = 82357,
800     Iop_Reverse16_8x8 = 82358,   800     Iop_Reverse16_8x8 = 82358,
801     Iop_Reverse32_8x8 = 82359,   801     Iop_Reverse32_8x8 = 82359,
802     Iop_Reverse32_16x4 = 82360,   802     Iop_Reverse32_16x4 = 82360,
803     Iop_Reverse64_8x8 = 82361,   803     Iop_Reverse64_8x8 = 82361,
804     Iop_Reverse64_16x4 = 82362,   804     Iop_Reverse64_16x4 = 82362,
805     Iop_Reverse64_32x2 = 82363,   805     Iop_Reverse64_32x2 = 82363,
806     Iop_Perm8x8 = 82364,   806     Iop_Perm8x8 = 82364,
807     Iop_Recip32x2 = 82365,   807     Iop_Recip32x2 = 82365,
808     Iop_Rsqrte32x2 = 82366,   808     Iop_Rsqrte32x2 = 82366,
809     Iop_Add32Fx4 = 82367,   809     Iop_Add32Fx4 = 82367,
810     Iop_Sub32Fx4 = 82368,   810     Iop_Sub32Fx4 = 82368,
811     Iop_Mul32Fx4 = 82369,   811     Iop_Mul32Fx4 = 82369,
812     Iop_Div32Fx4 = 82370,   812     Iop_Div32Fx4 = 82370,
813     Iop_Max32Fx4 = 82371,   813     Iop_Max32Fx4 = 82371,
814     Iop_Min32Fx4 = 82372,   814     Iop_Min32Fx4 = 82372,
815     Iop_Add32Fx2 = 82373,   815     Iop_Add32Fx2 = 82373,
816     Iop_Sub32Fx2 = 82374,   816     Iop_Sub32Fx2 = 82374,
817     Iop_CmpEQ32Fx4 = 82375,   817     Iop_CmpEQ32Fx4 = 82375,
818     Iop_CmpLT32Fx4 = 82376,   818     Iop_CmpLT32Fx4 = 82376,
819     Iop_CmpLE32Fx4 = 82377,   819     Iop_CmpLE32Fx4 = 82377,
820     Iop_CmpUN32Fx4 = 82378,   820     Iop_CmpUN32Fx4 = 82378,
821     Iop_CmpGT32Fx4 = 82379,   821     Iop_CmpGT32Fx4 = 82379,
822     Iop_CmpGE32Fx4 = 82380,   822     Iop_CmpGE32Fx4 = 82380,
823     Iop_Abs32Fx4 = 82381,   823     Iop_Abs32Fx4 = 82381,
824     Iop_PwMax32Fx4 = 82382,   824     Iop_PwMax32Fx4 = 82382,
825     Iop_PwMin32Fx4 = 82383,   825     Iop_PwMin32Fx4 = 82383,
826     Iop_Sqrt32Fx4 = 82384,   826     Iop_Sqrt32Fx4 = 82384,
827     Iop_RSqrt32Fx4 = 82385,   827     Iop_RSqrt32Fx4 = 82385,
828     Iop_Neg32Fx4 = 82386,   828     Iop_Neg32Fx4 = 82386,
829     Iop_Recip32Fx4 = 82387,   829     Iop_Recip32Fx4 = 82387,
830     Iop_Recps32Fx4 = 82388,   830     Iop_Recps32Fx4 = 82388,
831     Iop_Rsqrte32Fx4 = 82389,   831     Iop_Rsqrte32Fx4 = 82389,
832     Iop_Rsqrts32Fx4 = 82390,   832     Iop_Rsqrts32Fx4 = 82390,
833     Iop_I32UtoFx4 = 82391,   833     Iop_I32UtoFx4 = 82391,
834     Iop_I32StoFx4 = 82392,   834     Iop_I32StoFx4 = 82392,
835     Iop_FtoI32Ux4_RZ = 82393,   835     Iop_FtoI32Ux4_RZ = 82393,
836     Iop_FtoI32Sx4_RZ = 82394,   836     Iop_FtoI32Sx4_RZ = 82394,
837     Iop_QFtoI32Ux4_RZ = 82395,   837     Iop_QFtoI32Ux4_RZ = 82395,
838     Iop_QFtoI32Sx4_RZ = 82396,   838     Iop_QFtoI32Sx4_RZ = 82396,
839     Iop_RoundF32x4_RM = 82397,   839     Iop_RoundF32x4_RM = 82397,
840     Iop_RoundF32x4_RP = 82398,   840     Iop_RoundF32x4_RP = 82398,
841     Iop_RoundF32x4_RN = 82399,   841     Iop_RoundF32x4_RN = 82399,
842     Iop_RoundF32x4_RZ = 82400,   842     Iop_RoundF32x4_RZ = 82400,
843     Iop_F32ToFixed32Ux4_RZ = 82401,   843     Iop_F32ToFixed32Ux4_RZ = 82401,
844     Iop_F32ToFixed32Sx4_RZ = 82402,   844     Iop_F32ToFixed32Sx4_RZ = 82402,
845     Iop_Fixed32UToF32x4_RN = 82403,   845     Iop_Fixed32UToF32x4_RN = 82403,
846     Iop_Fixed32SToF32x4_RN = 82404,   846     Iop_Fixed32SToF32x4_RN = 82404,
847     Iop_F32toF16x4 = 82405,   847     Iop_F32toF16x4 = 82405,
848     Iop_F16toF32x4 = 82406,   848     Iop_F16toF32x4 = 82406,
849     Iop_Add32F0x4 = 82407,   849     Iop_Add32F0x4 = 82407,
850     Iop_Sub32F0x4 = 82408,   850     Iop_Sub32F0x4 = 82408,
851     Iop_Mul32F0x4 = 82409,   851     Iop_Mul32F0x4 = 82409,
852     Iop_Div32F0x4 = 82410,   852     Iop_Div32F0x4 = 82410,
853     Iop_Max32F0x4 = 82411,   853     Iop_Max32F0x4 = 82411,
854     Iop_Min32F0x4 = 82412,   854     Iop_Min32F0x4 = 82412,
855     Iop_CmpEQ32F0x4 = 82413,   855     Iop_CmpEQ32F0x4 = 82413,
856     Iop_CmpLT32F0x4 = 82414,   856     Iop_CmpLT32F0x4 = 82414,
857     Iop_CmpLE32F0x4 = 82415,   857     Iop_CmpLE32F0x4 = 82415,
858     Iop_CmpUN32F0x4 = 82416,   858     Iop_CmpUN32F0x4 = 82416,
859     Iop_Recip32F0x4 = 82417,   859     Iop_Recip32F0x4 = 82417,
860     Iop_Sqrt32F0x4 = 82418,   860     Iop_Sqrt32F0x4 = 82418,
861     Iop_RSqrt32F0x4 = 82419,   861     Iop_RSqrt32F0x4 = 82419,
862     Iop_Add64Fx2 = 82420,   862     Iop_Add64Fx2 = 82420,
863     Iop_Sub64Fx2 = 82421,   863     Iop_Sub64Fx2 = 82421,
864     Iop_Mul64Fx2 = 82422,   864     Iop_Mul64Fx2 = 82422,
865     Iop_Div64Fx2 = 82423,   865     Iop_Div64Fx2 = 82423,
866     Iop_Max64Fx2 = 82424,   866     Iop_Max64Fx2 = 82424,
867     Iop_Min64Fx2 = 82425,   867     Iop_Min64Fx2 = 82425,
868     Iop_CmpEQ64Fx2 = 82426,   868     Iop_CmpEQ64Fx2 = 82426,
869     Iop_CmpLT64Fx2 = 82427,   869     Iop_CmpLT64Fx2 = 82427,
870     Iop_CmpLE64Fx2 = 82428,   870     Iop_CmpLE64Fx2 = 82428,
871     Iop_CmpUN64Fx2 = 82429,   871     Iop_CmpUN64Fx2 = 82429,
872     Iop_Recip64Fx2 = 82430,   872     Iop_Recip64Fx2 = 82430,
873     Iop_Sqrt64Fx2 = 82431,   873     Iop_Sqrt64Fx2 = 82431,
874     Iop_RSqrt64Fx2 = 82432,   874     Iop_RSqrt64Fx2 = 82432,
875     Iop_Add64F0x2 = 82433,   875     Iop_Add64F0x2 = 82433,
876     Iop_Sub64F0x2 = 82434,   876     Iop_Sub64F0x2 = 82434,
877     Iop_Mul64F0x2 = 82435,   877     Iop_Mul64F0x2 = 82435,
878     Iop_Div64F0x2 = 82436,   878     Iop_Div64F0x2 = 82436,
879     Iop_Max64F0x2 = 82437,   879     Iop_Max64F0x2 = 82437,
880     Iop_Min64F0x2 = 82438,   880     Iop_Min64F0x2 = 82438,
881     Iop_CmpEQ64F0x2 = 82439,   881     Iop_CmpEQ64F0x2 = 82439,
882     Iop_CmpLT64F0x2 = 82440,   882     Iop_CmpLT64F0x2 = 82440,
883     Iop_CmpLE64F0x2 = 82441,   883     Iop_CmpLE64F0x2 = 82441,
884     Iop_CmpUN64F0x2 = 82442,   884     Iop_CmpUN64F0x2 = 82442,
885     Iop_Recip64F0x2 = 82443,   885     Iop_Recip64F0x2 = 82443,
886     Iop_Sqrt64F0x2 = 82444,   886     Iop_Sqrt64F0x2 = 82444,
887     Iop_RSqrt64F0x2 = 82445,   887     Iop_RSqrt64F0x2 = 82445,
888     Iop_V128to64 = 82446,   888     Iop_V128to64 = 82446,
889     Iop_V128HIto64 = 82447,   889     Iop_V128HIto64 = 82447,
890     Iop_64HLtoV128 = 82448,   890     Iop_64HLtoV128 = 82448,
891     Iop_64UtoV128 = 82449,   891     Iop_64UtoV128 = 82449,
892     Iop_SetV128lo64 = 82450,   892     Iop_SetV128lo64 = 82450,
893     Iop_32UtoV128 = 82451,   893     Iop_32UtoV128 = 82451,
894     Iop_V128to32 = 82452,   894     Iop_V128to32 = 82452,
895     Iop_SetV128lo32 = 82453,   895     Iop_SetV128lo32 = 82453,
896     Iop_NotV128 = 82454,   896     Iop_NotV128 = 82454,
897     Iop_AndV128 = 82455,   897     Iop_AndV128 = 82455,
898     Iop_OrV128 = 82456,   898     Iop_OrV128 = 82456,
899     Iop_XorV128 = 82457,   899     Iop_XorV128 = 82457,
900     Iop_ShlV128 = 82458,   900     Iop_ShlV128 = 82458,
901     Iop_ShrV128 = 82459,   901     Iop_ShrV128 = 82459,
902     Iop_CmpNEZ8x16 = 82460,   902     Iop_CmpNEZ8x16 = 82460,
903     Iop_CmpNEZ16x8 = 82461,   903     Iop_CmpNEZ16x8 = 82461,
904     Iop_CmpNEZ32x4 = 82462,   904     Iop_CmpNEZ32x4 = 82462,
905     Iop_CmpNEZ64x2 = 82463,   905     Iop_CmpNEZ64x2 = 82463,
906     Iop_Add8x16 = 82464,   906     Iop_Add8x16 = 82464,
907     Iop_Add16x8 = 82465,   907     Iop_Add16x8 = 82465,
908     Iop_Add32x4 = 82466,   908     Iop_Add32x4 = 82466,
909     Iop_Add64x2 = 82467,   909     Iop_Add64x2 = 82467,
910     Iop_QAdd8Ux16 = 82468,   910     Iop_QAdd8Ux16 = 82468,
911     Iop_QAdd16Ux8 = 82469,   911     Iop_QAdd16Ux8 = 82469,
912     Iop_QAdd32Ux4 = 82470,   912     Iop_QAdd32Ux4 = 82470,
913     Iop_QAdd64Ux2 = 82471,   913     Iop_QAdd64Ux2 = 82471,
914     Iop_QAdd8Sx16 = 82472,   914     Iop_QAdd8Sx16 = 82472,
915     Iop_QAdd16Sx8 = 82473,   915     Iop_QAdd16Sx8 = 82473,
916     Iop_QAdd32Sx4 = 82474,   916     Iop_QAdd32Sx4 = 82474,
917     Iop_QAdd64Sx2 = 82475,   917     Iop_QAdd64Sx2 = 82475,
918     Iop_Sub8x16 = 82476,   918     Iop_Sub8x16 = 82476,
919     Iop_Sub16x8 = 82477,   919     Iop_Sub16x8 = 82477,
920     Iop_Sub32x4 = 82478,   920     Iop_Sub32x4 = 82478,
921     Iop_Sub64x2 = 82479,   921     Iop_Sub64x2 = 82479,
922     Iop_QSub8Ux16 = 82480,   922     Iop_QSub8Ux16 = 82480,
923     Iop_QSub16Ux8 = 82481,   923     Iop_QSub16Ux8 = 82481,
924     Iop_QSub32Ux4 = 82482,   924     Iop_QSub32Ux4 = 82482,
925     Iop_QSub64Ux2 = 82483,   925     Iop_QSub64Ux2 = 82483,
926     Iop_QSub8Sx16 = 82484,   926     Iop_QSub8Sx16 = 82484,
927     Iop_QSub16Sx8 = 82485,   927     Iop_QSub16Sx8 = 82485,
928     Iop_QSub32Sx4 = 82486,   928     Iop_QSub32Sx4 = 82486,
929     Iop_QSub64Sx2 = 82487,   929     Iop_QSub64Sx2 = 82487,
930     Iop_Mul8x16 = 82488,   930     Iop_Mul8x16 = 82488,
931     Iop_Mul16x8 = 82489,   931     Iop_Mul16x8 = 82489,
932     Iop_Mul32x4 = 82490,   932     Iop_Mul32x4 = 82490,
933     Iop_MulHi16Ux8 = 82491,   933     Iop_MulHi16Ux8 = 82491,
934     Iop_MulHi32Ux4 = 82492,   934     Iop_MulHi32Ux4 = 82492,
935     Iop_MulHi16Sx8 = 82493,   935     Iop_MulHi16Sx8 = 82493,
936     Iop_MulHi32Sx4 = 82494,   936     Iop_MulHi32Sx4 = 82494,
937     Iop_MullEven8Ux16 = 82495,   937     Iop_MullEven8Ux16 = 82495,
938     Iop_MullEven16Ux8 = 82496,   938     Iop_MullEven16Ux8 = 82496,
939     Iop_MullEven8Sx16 = 82497,   939     Iop_MullEven8Sx16 = 82497,
940     Iop_MullEven16Sx8 = 82498,   940     Iop_MullEven16Sx8 = 82498,
941     Iop_Mull8Ux8 = 82499,   941     Iop_Mull8Ux8 = 82499,
942     Iop_Mull8Sx8 = 82500,   942     Iop_Mull8Sx8 = 82500,
943     Iop_Mull16Ux4 = 82501,   943     Iop_Mull16Ux4 = 82501,
944     Iop_Mull16Sx4 = 82502,   944     Iop_Mull16Sx4 = 82502,
945     Iop_Mull32Ux2 = 82503,   945     Iop_Mull32Ux2 = 82503,
946     Iop_Mull32Sx2 = 82504,   946     Iop_Mull32Sx2 = 82504,
947     Iop_QDMulHi16Sx8 = 82505,   947     Iop_QDMulHi16Sx8 = 82505,
948     Iop_QDMulHi32Sx4 = 82506,   948     Iop_QDMulHi32Sx4 = 82506,
949     Iop_QRDMulHi16Sx8 = 82507,   949     Iop_QRDMulHi16Sx8 = 82507,
950     Iop_QRDMulHi32Sx4 = 82508,   950     Iop_QRDMulHi32Sx4 = 82508,
951     Iop_QDMulLong16Sx4 = 82509,   951     Iop_QDMulLong16Sx4 = 82509,
952     Iop_QDMulLong32Sx2 = 82510,   952     Iop_QDMulLong32Sx2 = 82510,
953     Iop_PolynomialMul8x16 = 82511,   953     Iop_PolynomialMul8x16 = 82511,
954     Iop_PolynomialMull8x8 = 82512,   954     Iop_PolynomialMull8x8 = 82512,
955     Iop_PwAdd8x16 = 82513,   955     Iop_PwAdd8x16 = 82513,
956     Iop_PwAdd16x8 = 82514,   956     Iop_PwAdd16x8 = 82514,
957     Iop_PwAdd32x4 = 82515,   957     Iop_PwAdd32x4 = 82515,
958     Iop_PwAdd32Fx2 = 82516,   958     Iop_PwAdd32Fx2 = 82516,
959     Iop_PwAddL8Ux16 = 82517,   959     Iop_PwAddL8Ux16 = 82517,
960     Iop_PwAddL16Ux8 = 82518,   960     Iop_PwAddL16Ux8 = 82518,
961     Iop_PwAddL32Ux4 = 82519,   961     Iop_PwAddL32Ux4 = 82519,
962     Iop_PwAddL8Sx16 = 82520,   962     Iop_PwAddL8Sx16 = 82520,
963     Iop_PwAddL16Sx8 = 82521,   963     Iop_PwAddL16Sx8 = 82521,
964     Iop_PwAddL32Sx4 = 82522,   964     Iop_PwAddL32Sx4 = 82522,
965     Iop_Abs8x16 = 82523,   965     Iop_Abs8x16 = 82523,
966     Iop_Abs16x8 = 82524,   966     Iop_Abs16x8 = 82524,
967     Iop_Abs32x4 = 82525,   967     Iop_Abs32x4 = 82525,
968     Iop_Avg8Ux16 = 82526,   968     Iop_Avg8Ux16 = 82526,
969     Iop_Avg16Ux8 = 82527,   969     Iop_Avg16Ux8 = 82527,
970     Iop_Avg32Ux4 = 82528,   970     Iop_Avg32Ux4 = 82528,
971     Iop_Avg8Sx16 = 82529,   971     Iop_Avg8Sx16 = 82529,
972     Iop_Avg16Sx8 = 82530,   972     Iop_Avg16Sx8 = 82530,
973     Iop_Avg32Sx4 = 82531,   973     Iop_Avg32Sx4 = 82531,
974     Iop_Max8Sx16 = 82532,   974     Iop_Max8Sx16 = 82532,
975     Iop_Max16Sx8 = 82533,   975     Iop_Max16Sx8 = 82533,
976     Iop_Max32Sx4 = 82534,   976     Iop_Max32Sx4 = 82534,
977     Iop_Max8Ux16 = 82535,   977     Iop_Max8Ux16 = 82535,
978     Iop_Max16Ux8 = 82536,   978     Iop_Max16Ux8 = 82536,
979     Iop_Max32Ux4 = 82537,   979     Iop_Max32Ux4 = 82537,
980     Iop_Min8Sx16 = 82538,   980     Iop_Min8Sx16 = 82538,
981     Iop_Min16Sx8 = 82539,   981     Iop_Min16Sx8 = 82539,
982     Iop_Min32Sx4 = 82540,   982     Iop_Min32Sx4 = 82540,
983     Iop_Min8Ux16 = 82541,   983     Iop_Min8Ux16 = 82541,
984     Iop_Min16Ux8 = 82542,   984     Iop_Min16Ux8 = 82542,
985     Iop_Min32Ux4 = 82543,   985     Iop_Min32Ux4 = 82543,
986     Iop_CmpEQ8x16 = 82544,   986     Iop_CmpEQ8x16 = 82544,
987     Iop_CmpEQ16x8 = 82545,   987     Iop_CmpEQ16x8 = 82545,
988     Iop_CmpEQ32x4 = 82546,   988     Iop_CmpEQ32x4 = 82546,
989     Iop_CmpEQ64x2 = 82547,   989     Iop_CmpEQ64x2 = 82547,
990     Iop_CmpGT8Sx16 = 82548,   990     Iop_CmpGT8Sx16 = 82548,
991     Iop_CmpGT16Sx8 = 82549,   991     Iop_CmpGT16Sx8 = 82549,
992     Iop_CmpGT32Sx4 = 82550,   992     Iop_CmpGT32Sx4 = 82550,
993     Iop_CmpGT64Sx2 = 82551,   993     Iop_CmpGT64Sx2 = 82551,
994     Iop_CmpGT8Ux16 = 82552,   994     Iop_CmpGT8Ux16 = 82552,
995     Iop_CmpGT16Ux8 = 82553,   995     Iop_CmpGT16Ux8 = 82553,
996     Iop_CmpGT32Ux4 = 82554,   996     Iop_CmpGT32Ux4 = 82554,
997     Iop_Cnt8x16 = 82555,   997     Iop_Cnt8x16 = 82555,
998     Iop_Clz8Sx16 = 82556,   998     Iop_Clz8Sx16 = 82556,
999     Iop_Clz16Sx8 = 82557,   999     Iop_Clz16Sx8 = 82557,
1000     Iop_Clz32Sx4 = 82558,   1000     Iop_Clz32Sx4 = 82558,
1001     Iop_Cls8Sx16 = 82559,   1001     Iop_Cls8Sx16 = 82559,
1002     Iop_Cls16Sx8 = 82560,   1002     Iop_Cls16Sx8 = 82560,
1003     Iop_Cls32Sx4 = 82561,   1003     Iop_Cls32Sx4 = 82561,
1004     Iop_ShlN8x16 = 82562,   1004     Iop_ShlN8x16 = 82562,
1005     Iop_ShlN16x8 = 82563,   1005     Iop_ShlN16x8 = 82563,
1006     Iop_ShlN32x4 = 82564,   1006     Iop_ShlN32x4 = 82564,
1007     Iop_ShlN64x2 = 82565,   1007     Iop_ShlN64x2 = 82565,
1008     Iop_ShrN8x16 = 82566,   1008     Iop_ShrN8x16 = 82566,
1009     Iop_ShrN16x8 = 82567,   1009     Iop_ShrN16x8 = 82567,
1010     Iop_ShrN32x4 = 82568,   1010     Iop_ShrN32x4 = 82568,
1011     Iop_ShrN64x2 = 82569,   1011     Iop_ShrN64x2 = 82569,
1012     Iop_SarN8x16 = 82570,   1012     Iop_SarN8x16 = 82570,
1013     Iop_SarN16x8 = 82571,   1013     Iop_SarN16x8 = 82571,
1014     Iop_SarN32x4 = 82572,   1014     Iop_SarN32x4 = 82572,
1015     Iop_SarN64x2 = 82573,   1015     Iop_SarN64x2 = 82573,
1016     Iop_Shl8x16 = 82574,   1016     Iop_Shl8x16 = 82574,
1017     Iop_Shl16x8 = 82575,   1017     Iop_Shl16x8 = 82575,
1018     Iop_Shl32x4 = 82576,   1018     Iop_Shl32x4 = 82576,
1019     Iop_Shl64x2 = 82577,   1019     Iop_Shl64x2 = 82577,
1020     Iop_Shr8x16 = 82578,   1020     Iop_Shr8x16 = 82578,
1021     Iop_Shr16x8 = 82579,   1021     Iop_Shr16x8 = 82579,
1022     Iop_Shr32x4 = 82580,   1022     Iop_Shr32x4 = 82580,
1023     Iop_Shr64x2 = 82581,   1023     Iop_Shr64x2 = 82581,
1024     Iop_Sar8x16 = 82582,   1024     Iop_Sar8x16 = 82582,
1025     Iop_Sar16x8 = 82583,   1025     Iop_Sar16x8 = 82583,
1026     Iop_Sar32x4 = 82584,   1026     Iop_Sar32x4 = 82584,
1027     Iop_Sar64x2 = 82585,   1027     Iop_Sar64x2 = 82585,
1028     Iop_Sal8x16 = 82586,   1028     Iop_Sal8x16 = 82586,
1029     Iop_Sal16x8 = 82587,   1029     Iop_Sal16x8 = 82587,
1030     Iop_Sal32x4 = 82588,   1030     Iop_Sal32x4 = 82588,
1031     Iop_Sal64x2 = 82589,   1031     Iop_Sal64x2 = 82589,
1032     Iop_Rol8x16 = 82590,   1032     Iop_Rol8x16 = 82590,
1033     Iop_Rol16x8 = 82591,   1033     Iop_Rol16x8 = 82591,
1034     Iop_Rol32x4 = 82592,   1034     Iop_Rol32x4 = 82592,
1035     Iop_QShl8x16 = 82593,   1035     Iop_QShl8x16 = 82593,
1036     Iop_QShl16x8 = 82594,   1036     Iop_QShl16x8 = 82594,
1037     Iop_QShl32x4 = 82595,   1037     Iop_QShl32x4 = 82595,
1038     Iop_QShl64x2 = 82596,   1038     Iop_QShl64x2 = 82596,
1039     Iop_QSal8x16 = 82597,   1039     Iop_QSal8x16 = 82597,
1040     Iop_QSal16x8 = 82598,   1040     Iop_QSal16x8 = 82598,
1041     Iop_QSal32x4 = 82599,   1041     Iop_QSal32x4 = 82599,
1042     Iop_QSal64x2 = 82600,   1042     Iop_QSal64x2 = 82600,
1043     Iop_QShlN8Sx16 = 82601,   1043     Iop_QShlN8Sx16 = 82601,
1044     Iop_QShlN16Sx8 = 82602,   1044     Iop_QShlN16Sx8 = 82602,
1045     Iop_QShlN32Sx4 = 82603,   1045     Iop_QShlN32Sx4 = 82603,
1046     Iop_QShlN64Sx2 = 82604,   1046     Iop_QShlN64Sx2 = 82604,
1047     Iop_QShlN8x16 = 82605,   1047     Iop_QShlN8x16 = 82605,
1048     Iop_QShlN16x8 = 82606,   1048     Iop_QShlN16x8 = 82606,
1049     Iop_QShlN32x4 = 82607,   1049     Iop_QShlN32x4 = 82607,
1050     Iop_QShlN64x2 = 82608,   1050     Iop_QShlN64x2 = 82608,
1051     Iop_QSalN8x16 = 82609,   1051     Iop_QSalN8x16 = 82609,
1052     Iop_QSalN16x8 = 82610,   1052     Iop_QSalN16x8 = 82610,
1053     Iop_QSalN32x4 = 82611,   1053     Iop_QSalN32x4 = 82611,
1054     Iop_QSalN64x2 = 82612,   1054     Iop_QSalN64x2 = 82612,
1055     Iop_QNarrowBin16Sto8Ux16 = 82613,   1055     Iop_QNarrowBin16Sto8Ux16 = 82613,
1056     Iop_QNarrowBin32Sto16Ux8 = 82614,   1056     Iop_QNarrowBin32Sto16Ux8 = 82614,
1057     Iop_QNarrowBin16Sto8Sx16 = 82615,   1057     Iop_QNarrowBin16Sto8Sx16 = 82615,
1058     Iop_QNarrowBin32Sto16Sx8 = 82616,   1058     Iop_QNarrowBin32Sto16Sx8 = 82616,
1059     Iop_QNarrowBin16Uto8Ux16 = 82617,   1059     Iop_QNarrowBin16Uto8Ux16 = 82617,
1060     Iop_QNarrowBin32Uto16Ux8 = 82618,   1060     Iop_QNarrowBin32Uto16Ux8 = 82618,
1061     Iop_NarrowBin16to8x16 = 82619,   1061     Iop_NarrowBin16to8x16 = 82619,
1062     Iop_NarrowBin32to16x8 = 82620,   1062     Iop_NarrowBin32to16x8 = 82620,
1063     Iop_NarrowUn16to8x8 = 82621,   1063     Iop_NarrowUn16to8x8 = 82621,
1064     Iop_NarrowUn32to16x4 = 82622,   1064     Iop_NarrowUn32to16x4 = 82622,
1065     Iop_NarrowUn64to32x2 = 82623,   1065     Iop_NarrowUn64to32x2 = 82623,
1066     Iop_QNarrowUn16Sto8Sx8 = 82624,   1066     Iop_QNarrowUn16Sto8Sx8 = 82624,
1067     Iop_QNarrowUn32Sto16Sx4 = 82625,   1067     Iop_QNarrowUn32Sto16Sx4 = 82625,
1068     Iop_QNarrowUn64Sto32Sx2 = 82626,   1068     Iop_QNarrowUn64Sto32Sx2 = 82626,
1069     Iop_QNarrowUn16Sto8Ux8 = 82627,   1069     Iop_QNarrowUn16Sto8Ux8 = 82627,
1070     Iop_QNarrowUn32Sto16Ux4 = 82628,   1070     Iop_QNarrowUn32Sto16Ux4 = 82628,
1071     Iop_QNarrowUn64Sto32Ux2 = 82629,   1071     Iop_QNarrowUn64Sto32Ux2 = 82629,
1072     Iop_QNarrowUn16Uto8Ux8 = 82630,   1072     Iop_QNarrowUn16Uto8Ux8 = 82630,
1073     Iop_QNarrowUn32Uto16Ux4 = 82631,   1073     Iop_QNarrowUn32Uto16Ux4 = 82631,
1074     Iop_QNarrowUn64Uto32Ux2 = 82632,   1074     Iop_QNarrowUn64Uto32Ux2 = 82632,
1075     Iop_Widen8Uto16x8 = 82633,   1075     Iop_Widen8Uto16x8 = 82633,
1076     Iop_Widen16Uto32x4 = 82634,   1076     Iop_Widen16Uto32x4 = 82634,
1077     Iop_Widen32Uto64x2 = 82635,   1077     Iop_Widen32Uto64x2 = 82635,
1078     Iop_Widen8Sto16x8 = 82636,   1078     Iop_Widen8Sto16x8 = 82636,
1079     Iop_Widen16Sto32x4 = 82637,   1079     Iop_Widen16Sto32x4 = 82637,
1080     Iop_Widen32Sto64x2 = 82638,   1080     Iop_Widen32Sto64x2 = 82638,
1081     Iop_InterleaveHI8x16 = 82639,   1081     Iop_InterleaveHI8x16 = 82639,
1082     Iop_InterleaveHI16x8 = 82640,   1082     Iop_InterleaveHI16x8 = 82640,
1083     Iop_InterleaveHI32x4 = 82641,   1083     Iop_InterleaveHI32x4 = 82641,
1084     Iop_InterleaveHI64x2 = 82642,   1084     Iop_InterleaveHI64x2 = 82642,
1085     Iop_InterleaveLO8x16 = 82643,   1085     Iop_InterleaveLO8x16 = 82643,
1086     Iop_InterleaveLO16x8 = 82644,   1086     Iop_InterleaveLO16x8 = 82644,
1087     Iop_InterleaveLO32x4 = 82645,   1087     Iop_InterleaveLO32x4 = 82645,
1088     Iop_InterleaveLO64x2 = 82646,   1088     Iop_InterleaveLO64x2 = 82646,
1089     Iop_InterleaveOddLanes8x16 = 82647,   1089     Iop_InterleaveOddLanes8x16 = 82647,
1090     Iop_InterleaveEvenLanes8x16 = 82648,   1090     Iop_InterleaveEvenLanes8x16 = 82648,
1091     Iop_InterleaveOddLanes16x8 = 82649,   1091     Iop_InterleaveOddLanes16x8 = 82649,
1092     Iop_InterleaveEvenLanes16x8 = 82650,   1092     Iop_InterleaveEvenLanes16x8 = 82650,
1093     Iop_InterleaveOddLanes32x4 = 82651,   1093     Iop_InterleaveOddLanes32x4 = 82651,
1094     Iop_InterleaveEvenLanes32x4 = 82652,   1094     Iop_InterleaveEvenLanes32x4 = 82652,
1095     Iop_CatOddLanes8x16 = 82653,   1095     Iop_CatOddLanes8x16 = 82653,
1096     Iop_CatOddLanes16x8 = 82654,   1096     Iop_CatOddLanes16x8 = 82654,
1097     Iop_CatOddLanes32x4 = 82655,   1097     Iop_CatOddLanes32x4 = 82655,
1098     Iop_CatEvenLanes8x16 = 82656,   1098     Iop_CatEvenLanes8x16 = 82656,
1099     Iop_CatEvenLanes16x8 = 82657,   1099     Iop_CatEvenLanes16x8 = 82657,
1100     Iop_CatEvenLanes32x4 = 82658,   1100     Iop_CatEvenLanes32x4 = 82658,
1101     Iop_GetElem8x16 = 82659,   1101     Iop_GetElem8x16 = 82659,
1102     Iop_GetElem16x8 = 82660,   1102     Iop_GetElem16x8 = 82660,
1103     Iop_GetElem32x4 = 82661,   1103     Iop_GetElem32x4 = 82661,
1104     Iop_GetElem64x2 = 82662,   1104     Iop_GetElem64x2 = 82662,
1105     Iop_Dup8x16 = 82663,   1105     Iop_Dup8x16 = 82663,
1106     Iop_Dup16x8 = 82664,   1106     Iop_Dup16x8 = 82664,
1107     Iop_Dup32x4 = 82665,   1107     Iop_Dup32x4 = 82665,
1108     Iop_ExtractV128 = 82666,   1108     Iop_ExtractV128 = 82666,
1109     Iop_Reverse16_8x16 = 82667,   1109     Iop_Reverse16_8x16 = 82667,
1110     Iop_Reverse32_8x16 = 82668,   1110     Iop_Reverse32_8x16 = 82668,
1111     Iop_Reverse32_16x8 = 82669,   1111     Iop_Reverse32_16x8 = 82669,
1112     Iop_Reverse64_8x16 = 82670,   1112     Iop_Reverse64_8x16 = 82670,
1113     Iop_Reverse64_16x8 = 82671,   1113     Iop_Reverse64_16x8 = 82671,
1114     Iop_Reverse64_32x4 = 82672,   1114     Iop_Reverse64_32x4 = 82672,
1115     Iop_Perm8x16 = 82673,   1115     Iop_Perm8x16 = 82673,
1116     Iop_Recip32x4 = 82674,   1116     Iop_Recip32x4 = 82674,
1117     Iop_Rsqrte32x4 = 82675   1117     Iop_Rsqrte32x4 = 82675
1118 } ;   1118 } ;
1119 typedef enum __anonenum_IROp_36 IROp;   1119 typedef enum __anonenum_IROp_36 IROp;
1120 enum __anonenum_IRRoundingMode_37 {   1120 enum __anonenum_IRRoundingMode_37 {
1121     Irrm_NEAREST = 0,   1121     Irrm_NEAREST = 0,
1122     Irrm_NegINF = 1,   1122     Irrm_NegINF = 1,
1123     Irrm_PosINF = 2,   1123     Irrm_PosINF = 2,
1124     Irrm_ZERO = 3   1124     Irrm_ZERO = 3
1125 } ;   1125 } ;
1126 typedef enum __anonenum_IRRoundingMode_37 IRRoundingMode;   1126 typedef enum __anonenum_IRRoundingMode_37 IRRoundingMode;
1127 enum __anonenum_IRCmpF64Result_38 {   1127 enum __anonenum_IRCmpF64Result_38 {
1128     Ircr_UN = 69,   1128     Ircr_UN = 69,
1129     Ircr_LT = 1,   1129     Ircr_LT = 1,
1130     Ircr_GT = 0,   1130     Ircr_GT = 0,
1131     Ircr_EQ = 64   1131     Ircr_EQ = 64
1132 } ;   1132 } ;
1133 typedef enum __anonenum_IRCmpF64Result_38 IRCmpF64Result;   1133 typedef enum __anonenum_IRCmpF64Result_38 IRCmpF64Result;
1134 typedef IRCmpF64Result IRCmpF32Result;   1134 typedef IRCmpF64Result IRCmpF32Result;
1135 typedef IRCmpF64Result IRCmpF128Result;   1135 typedef IRCmpF64Result IRCmpF128Result;
1136 enum __anonenum_IRExprTag_39 {   1136 enum __anonenum_IRExprTag_39 {
1137     Iex_Binder = 86016,   1137     Iex_Binder = 86016,
1138     Iex_Get = 86017,   1138     Iex_Get = 86017,
1139     Iex_GetI = 86018,   1139     Iex_GetI = 86018,
1140     Iex_RdTmp = 86019,   1140     Iex_RdTmp = 86019,
1141     Iex_Qop = 86020,   1141     Iex_Qop = 86020,
1142     Iex_Triop = 86021,   1142     Iex_Triop = 86021,
1143     Iex_Binop = 86022,   1143     Iex_Binop = 86022,
1144     Iex_Unop = 86023,   1144     Iex_Unop = 86023,
1145     Iex_Load = 86024,   1145     Iex_Load = 86024,
1146     Iex_Const = 86025,   1146     Iex_Const = 86025,
1147     Iex_Mux0X = 86026,   1147     Iex_Mux0X = 86026,
1148     Iex_CCall = 86027   1148     Iex_CCall = 86027
1149 } ;   1149 } ;
1150 typedef enum __anonenum_IRExprTag_39 IRExprTag;   1150 typedef enum __anonenum_IRExprTag_39 IRExprTag;
1151 struct _IRExpr;   1151 struct _IRExpr;
1152 typedef struct _IRExpr IRExpr;   1152 typedef struct _IRExpr IRExpr;
1153 struct __anonstruct_Binder_41 {   1153 struct __anonstruct_Binder_41 {
1154    Int binder ;   1154    Int binder ;
1155 };   1155 };
1156 struct __anonstruct_Get_42 {   1156 struct __anonstruct_Get_42 {
1157    Int offset ;   1157    Int offset ;
1158    IRType ty ;   1158    IRType ty ;
1159 };   1159 };
1160 struct __anonstruct_GetI_43 {   1160 struct __anonstruct_GetI_43 {
1161    IRRegArray *descr ;   1161    IRRegArray *descr ;
1162    IRExpr *ix ;   1162    IRExpr *ix ;
1163    Int bias ;   1163    Int bias ;
1164 };   1164 };
1165 struct __anonstruct_RdTmp_44 {   1165 struct __anonstruct_RdTmp_44 {
1166    IRTemp tmp ;   1166    IRTemp tmp ;
1167 };   1167 };
1168 struct __anonstruct_Qop_45 {   1168 struct __anonstruct_Qop_45 {
1169    IROp op ;   1169    IROp op ;
1170    IRExpr *arg1 ;   1170    IRExpr *arg1 ;
1171    IRExpr *arg2 ;   1171    IRExpr *arg2 ;
1172    IRExpr *arg3 ;   1172    IRExpr *arg3 ;
1173    IRExpr *arg4 ;   1173    IRExpr *arg4 ;
1174 };   1174 };
1175 struct __anonstruct_Triop_46 {   1175 struct __anonstruct_Triop_46 {
1176    IROp op ;   1176    IROp op ;
1177    IRExpr *arg1 ;   1177    IRExpr *arg1 ;
1178    IRExpr *arg2 ;   1178    IRExpr *arg2 ;
1179    IRExpr *arg3 ;   1179    IRExpr *arg3 ;
1180 };   1180 };
1181 struct __anonstruct_Binop_47 {   1181 struct __anonstruct_Binop_47 {
1182    IROp op ;   1182    IROp op ;
1183    IRExpr *arg1 ;   1183    IRExpr *arg1 ;
1184    IRExpr *arg2 ;   1184    IRExpr *arg2 ;
1185 };   1185 };
1186 struct __anonstruct_Unop_48 {   1186 struct __anonstruct_Unop_48 {
1187    IROp op ;   1187    IROp op ;
1188    IRExpr *arg ;   1188    IRExpr *arg ;
1189 };   1189 };
1190 struct __anonstruct_Load_49 {   1190 struct __anonstruct_Load_49 {
1191    IREndness end ;   1191    IREndness end ;
1192    IRType ty ;   1192    IRType ty ;
1193    IRExpr *addr ;   1193    IRExpr *addr ;
1194 };   1194 };
1195 struct __anonstruct_Const_50 {   1195 struct __anonstruct_Const_50 {
1196    IRConst *con ;   1196    IRConst *con ;
1197 };   1197 };
1198 struct __anonstruct_CCall_51 {   1198 struct __anonstruct_CCall_51 {
1199    IRCallee *cee ;   1199    IRCallee *cee ;
1200    IRType retty ;   1200    IRType retty ;
1201    IRExpr **args ;   1201    IRExpr **args ;
1202 };   1202 };
1203 struct __anonstruct_Mux0X_52 {   1203 struct __anonstruct_Mux0X_52 {
1204    IRExpr *cond ;   1204    IRExpr *cond ;
1205    IRExpr *expr0 ;   1205    IRExpr *expr0 ;
1206    IRExpr *exprX ;   1206    IRExpr *exprX ;
1207 };   1207 };
1208 union __anonunion_Iex_40 {   1208 union __anonunion_Iex_40 {
1209    struct __anonstruct_Binder_41 Binder ;   1209    struct __anonstruct_Binder_41 Binder ;
1210    struct __anonstruct_Get_42 Get ;   1210    struct __anonstruct_Get_42 Get ;
1211    struct __anonstruct_GetI_43 GetI ;   1211    struct __anonstruct_GetI_43 GetI ;
1212    struct __anonstruct_RdTmp_44 RdTmp ;   1212    struct __anonstruct_RdTmp_44 RdTmp ;
1213    struct __anonstruct_Qop_45 Qop ;   1213    struct __anonstruct_Qop_45 Qop ;
1214    struct __anonstruct_Triop_46 Triop ;   1214    struct __anonstruct_Triop_46 Triop ;
1215    struct __anonstruct_Binop_47 Binop ;   1215    struct __anonstruct_Binop_47 Binop ;
1216    struct __anonstruct_Unop_48 Unop ;   1216    struct __anonstruct_Unop_48 Unop ;
1217    struct __anonstruct_Load_49 Load ;   1217    struct __anonstruct_Load_49 Load ;
1218    struct __anonstruct_Const_50 Const ;   1218    struct __anonstruct_Const_50 Const ;
1219    struct __anonstruct_CCall_51 CCall ;   1219    struct __anonstruct_CCall_51 CCall ;
1220    struct __anonstruct_Mux0X_52 Mux0X ;   1220    struct __anonstruct_Mux0X_52 Mux0X ;
1221 };   1221 };
1222 struct _IRExpr {   1222 struct _IRExpr {
1223    IRExprTag tag ;   1223    IRExprTag tag ;
1224    union __anonunion_Iex_40 Iex ;   1224    union __anonunion_Iex_40 Iex ;
1225 };   1225 };
1226 enum __anonenum_IRJumpKind_53 {   1226 enum __anonenum_IRJumpKind_53 {
1227     Ijk_Boring = 90112,   1227     Ijk_Boring = 90112,
1228     Ijk_Call = 90113,   1228     Ijk_Call = 90113,
1229     Ijk_Ret = 90114,   1229     Ijk_Ret = 90114,
1230     Ijk_ClientReq = 90115,   1230     Ijk_ClientReq = 90115,
1231     Ijk_Yield = 90116,   1231     Ijk_Yield = 90116,
1232     Ijk_EmWarn = 90117,   1232     Ijk_EmWarn = 90117,
1233     Ijk_EmFail = 90118,   1233     Ijk_EmFail = 90118,
1234     Ijk_NoDecode = 90119,   1234     Ijk_NoDecode = 90119,
1235     Ijk_MapFail = 90120,   1235     Ijk_MapFail = 90120,
1236     Ijk_TInval = 90121,   1236     Ijk_TInval = 90121,
1237     Ijk_NoRedir = 90122,   1237     Ijk_NoRedir = 90122,
1238     Ijk_SigTRAP = 90123,   1238     Ijk_SigTRAP = 90123,
1239     Ijk_SigSEGV = 90124,   1239     Ijk_SigSEGV = 90124,
1240     Ijk_SigBUS = 90125,   1240     Ijk_SigBUS = 90125,
1241     Ijk_Sys_syscall = 90126,   1241     Ijk_Sys_syscall = 90126,
1242     Ijk_Sys_int32 = 90127,   1242     Ijk_Sys_int32 = 90127,
1243     Ijk_Sys_int128 = 90128,   1243     Ijk_Sys_int128 = 90128,
1244     Ijk_Sys_int129 = 90129,   1244     Ijk_Sys_int129 = 90129,
1245     Ijk_Sys_int130 = 90130,   1245     Ijk_Sys_int130 = 90130,
1246     Ijk_Sys_sysenter = 90131   1246     Ijk_Sys_sysenter = 90131
1247 } ;   1247 } ;
1248 typedef enum __anonenum_IRJumpKind_53 IRJumpKind;   1248 typedef enum __anonenum_IRJumpKind_53 IRJumpKind;
1249 enum __anonenum_IREffect_54 {   1249 enum __anonenum_IREffect_54 {
1250     Ifx_None = 94208,   1250     Ifx_None = 94208,
1251     Ifx_Read = 94209,   1251     Ifx_Read = 94209,
1252     Ifx_Write = 94210,   1252     Ifx_Write = 94210,
1253     Ifx_Modify = 94211   1253     Ifx_Modify = 94211
1254 } ;   1254 } ;
1255 typedef enum __anonenum_IREffect_54 IREffect;   1255 typedef enum __anonenum_IREffect_54 IREffect;
1256 struct __anonstruct_fxState_56 {   1256 struct __anonstruct_fxState_56 {
1257    IREffect fx ;   1257    IREffect fx ;
1258    Int offset ;   1258    Int offset ;
1259    Int size ;   1259    Int size ;
1260 };   1260 };
1261 struct __anonstruct_IRDirty_55 {   1261 struct __anonstruct_IRDirty_55 {
1262    IRCallee *cee ;   1262    IRCallee *cee ;
1263    IRExpr *guard ;   1263    IRExpr *guard ;
1264    IRExpr **args ;   1264    IRExpr **args ;
1265    IRTemp tmp ;   1265    IRTemp tmp ;
1266    IREffect mFx ;   1266    IREffect mFx ;
1267    IRExpr *mAddr ;   1267    IRExpr *mAddr ;
1268    Int mSize ;   1268    Int mSize ;
1269    Bool needsBBP ;   1269    Bool needsBBP ;
1270    Int nFxState ;   1270    Int nFxState ;
1271    struct __anonstruct_fxState_56 fxState[7] ;   1271    struct __anonstruct_fxState_56 fxState[7] ;
1272 };   1272 };
1273 typedef struct __anonstruct_IRDirty_55 IRDirty;   1273 typedef struct __anonstruct_IRDirty_55 IRDirty;
1274 enum __anonenum_IRMBusEvent_57 {   1274 enum __anonenum_IRMBusEvent_57 {
1275     Imbe_Fence = 98304,   1275     Imbe_Fence = 98304,
1276     Imbe_CancelReservation = 98305   1276     Imbe_CancelReservation = 98305
1277 } ;   1277 } ;
1278 typedef enum __anonenum_IRMBusEvent_57 IRMBusEvent;   1278 typedef enum __anonenum_IRMBusEvent_57 IRMBusEvent;
1279 struct __anonstruct_IRCAS_58 {   1279 struct __anonstruct_IRCAS_58 {
1280    IRTemp oldHi ;   1280    IRTemp oldHi ;
1281    IRTemp oldLo ;   1281    IRTemp oldLo ;
1282    IREndness end ;   1282    IREndness end ;
1283    IRExpr *addr ;   1283    IRExpr *addr ;
1284    IRExpr *expdHi ;   1284    IRExpr *expdHi ;
1285    IRExpr *expdLo ;   1285    IRExpr *expdLo ;
1286    IRExpr *dataHi ;   1286    IRExpr *dataHi ;
1287    IRExpr *dataLo ;   1287    IRExpr *dataLo ;
1288 };   1288 };
1289 typedef struct __anonstruct_IRCAS_58 IRCAS;   1289 typedef struct __anonstruct_IRCAS_58 IRCAS;
1290 enum __anonenum_IRStmtTag_59 {   1290 enum __anonenum_IRStmtTag_59 {
1291     Ist_NoOp = 102400,   1291     Ist_NoOp = 102400,
1292     Ist_IMark = 102401,   1292     Ist_IMark = 102401,
1293     Ist_AbiHint = 102402,   1293     Ist_AbiHint = 102402,
1294     Ist_Put = 102403,   1294     Ist_Put = 102403,
1295     Ist_PutI = 102404,   1295     Ist_PutI = 102404,
1296     Ist_WrTmp = 102405,   1296     Ist_WrTmp = 102405,
1297     Ist_Store = 102406,   1297     Ist_Store = 102406,
1298     Ist_CAS = 102407,   1298     Ist_CAS = 102407,
1299     Ist_LLSC = 102408,   1299     Ist_LLSC = 102408,
1300     Ist_Dirty = 102409,   1300     Ist_Dirty = 102409,
1301     Ist_MBE = 102410,   1301     Ist_MBE = 102410,
1302     Ist_Exit = 102411   1302     Ist_Exit = 102411
1303 } ;   1303 } ;
1304 typedef enum __anonenum_IRStmtTag_59 IRStmtTag;   1304 typedef enum __anonenum_IRStmtTag_59 IRStmtTag;
1305 struct __anonstruct_NoOp_61 {   1305 struct __anonstruct_NoOp_61 {
1306     1306  
1307 };   1307 };
1308 struct __anonstruct_IMark_62 {   1308 struct __anonstruct_IMark_62 {
1309    Addr64 addr ;   1309    Addr64 addr ;
1310    Int len ;   1310    Int len ;
1311    UChar delta ;   1311    UChar delta ;
1312 };   1312 };
1313 struct __anonstruct_AbiHint_63 {   1313 struct __anonstruct_AbiHint_63 {
1314    IRExpr *base ;   1314    IRExpr *base ;
1315    Int len ;   1315    Int len ;
1316    IRExpr *nia ;   1316    IRExpr *nia ;
1317 };   1317 };
1318 struct __anonstruct_Put_64 {   1318 struct __anonstruct_Put_64 {
1319    Int offset ;   1319    Int offset ;
1320    IRExpr *data ;   1320    IRExpr *data ;
1321 };   1321 };
1322 struct __anonstruct_PutI_65 {   1322 struct __anonstruct_PutI_65 {
1323    IRRegArray *descr ;   1323    IRRegArray *descr ;
1324    IRExpr *ix ;   1324    IRExpr *ix ;
1325    Int bias ;   1325    Int bias ;
1326    IRExpr *data ;   1326    IRExpr *data ;
1327 };   1327 };
1328 struct __anonstruct_WrTmp_66 {   1328 struct __anonstruct_WrTmp_66 {
1329    IRTemp tmp ;   1329    IRTemp tmp ;
1330    IRExpr *data ;   1330    IRExpr *data ;
1331 };   1331 };
1332 struct __anonstruct_Store_67 {   1332 struct __anonstruct_Store_67 {
1333    IREndness end ;   1333    IREndness end ;
1334    IRExpr *addr ;   1334    IRExpr *addr ;
1335    IRExpr *data ;   1335    IRExpr *data ;
1336 };   1336 };
1337 struct __anonstruct_CAS_68 {   1337 struct __anonstruct_CAS_68 {
1338    IRCAS *details ;   1338    IRCAS *details ;
1339 };   1339 };
1340 struct __anonstruct_LLSC_69 {   1340 struct __anonstruct_LLSC_69 {
1341    IREndness end ;   1341    IREndness end ;
1342    IRTemp result ;   1342    IRTemp result ;
1343    IRExpr *addr ;   1343    IRExpr *addr ;
1344    IRExpr *storedata ;   1344    IRExpr *storedata ;
1345 };   1345 };
1346 struct __anonstruct_Dirty_70 {   1346 struct __anonstruct_Dirty_70 {
1347    IRDirty *details ;   1347    IRDirty *details ;
1348 };   1348 };
1349 struct __anonstruct_MBE_71 {   1349 struct __anonstruct_MBE_71 {
1350    IRMBusEvent event ;   1350    IRMBusEvent event ;
1351 };   1351 };
1352 struct __anonstruct_Exit_72 {   1352 struct __anonstruct_Exit_72 {
1353    IRExpr *guard ;   1353    IRExpr *guard ;
1354    IRJumpKind jk ;   1354    IRJumpKind jk ;
1355    IRConst *dst ;   1355    IRConst *dst ;
1356 };   1356 };
1357 union __anonunion_Ist_60 {   1357 union __anonunion_Ist_60 {
1358    struct __anonstruct_NoOp_61 NoOp ;   1358    struct __anonstruct_NoOp_61 NoOp ;
1359    struct __anonstruct_IMark_62 IMark ;   1359    struct __anonstruct_IMark_62 IMark ;
1360    struct __anonstruct_AbiHint_63 AbiHint ;   1360    struct __anonstruct_AbiHint_63 AbiHint ;
1361    struct __anonstruct_Put_64 Put ;   1361    struct __anonstruct_Put_64 Put ;
1362    struct __anonstruct_PutI_65 PutI ;   1362    struct __anonstruct_PutI_65 PutI ;
1363    struct __anonstruct_WrTmp_66 WrTmp ;   1363    struct __anonstruct_WrTmp_66 WrTmp ;
1364    struct __anonstruct_Store_67 Store ;   1364    struct __anonstruct_Store_67 Store ;
1365    struct __anonstruct_CAS_68 CAS ;   1365    struct __anonstruct_CAS_68 CAS ;
1366    struct __anonstruct_LLSC_69 LLSC ;   1366    struct __anonstruct_LLSC_69 LLSC ;
1367    struct __anonstruct_Dirty_70 Dirty ;   1367    struct __anonstruct_Dirty_70 Dirty ;
1368    struct __anonstruct_MBE_71 MBE ;   1368    struct __anonstruct_MBE_71 MBE ;
1369    struct __anonstruct_Exit_72 Exit ;   1369    struct __anonstruct_Exit_72 Exit ;
1370 };   1370 };
1371 struct _IRStmt {   1371 struct _IRStmt {
1372    IRStmtTag tag ;   1372    IRStmtTag tag ;
1373    union __anonunion_Ist_60 Ist ;   1373    union __anonunion_Ist_60 Ist ;
1374 };   1374 };
1375 typedef struct _IRStmt IRStmt;   1375 typedef struct _IRStmt IRStmt;
1376 struct __anonstruct_IRTypeEnv_73 {   1376 struct __anonstruct_IRTypeEnv_73 {
1377    IRType *types ;   1377    IRType *types ;
1378    Int types_size ;   1378    Int types_size ;
1379    Int types_used ;   1379    Int types_used ;
1380 };   1380 };
1381 typedef struct __anonstruct_IRTypeEnv_73 IRTypeEnv;   1381 typedef struct __anonstruct_IRTypeEnv_73 IRTypeEnv;
1382 struct __anonstruct_IRSB_74 {   1382 struct __anonstruct_IRSB_74 {
1383    IRTypeEnv *tyenv ;   1383    IRTypeEnv *tyenv ;
1384    IRStmt **stmts ;   1384    IRStmt **stmts ;
1385    Int stmts_size ;   1385    Int stmts_size ;
1386    Int stmts_used ;   1386    Int stmts_used ;
1387    IRExpr *next ;   1387    IRExpr *next ;
1388    IRJumpKind jumpkind ;   1388    IRJumpKind jumpkind ;
1389 };   1389 };
1390 typedef struct __anonstruct_IRSB_74 IRSB;   1390 typedef struct __anonstruct_IRSB_74 IRSB;
1391 enum __anonenum_VexArch_75 {   1391 enum __anonenum_VexArch_75 {
1392     VexArch_INVALID = 0,   1392     VexArch_INVALID = 0,
1393     VexArchX86 = 1,   1393     VexArchX86 = 1,
1394     VexArchAMD64 = 2,   1394     VexArchAMD64 = 2,
1395     VexArchARM = 3,   1395     VexArchARM = 3,
1396     VexArchPPC32 = 4,   1396     VexArchPPC32 = 4,
1397     VexArchPPC64 = 5,   1397     VexArchPPC64 = 5,
1398     VexArchS390X = 6   1398     VexArchS390X = 6
1399 } ;   1399 } ;
1400 typedef enum __anonenum_VexArch_75 VexArch;   1400 typedef enum __anonenum_VexArch_75 VexArch;
1401 struct __anonstruct_VexArchInfo_76 {   1401 struct __anonstruct_VexArchInfo_76 {
1402    UInt hwcaps ;   1402    UInt hwcaps ;
1403    Int ppc_cache_line_szB ;   1403    Int ppc_cache_line_szB ;
1404    UInt ppc_dcbz_szB ;   1404    UInt ppc_dcbz_szB ;
1405    UInt ppc_dcbzl_szB ;   1405    UInt ppc_dcbzl_szB ;
1406 };   1406 };
1407 typedef struct __anonstruct_VexArchInfo_76 VexArchInfo;   1407 typedef struct __anonstruct_VexArchInfo_76 VexArchInfo;
1408 struct __anonstruct_VexAbiInfo_77 {   1408 struct __anonstruct_VexAbiInfo_77 {
1409    Int guest_stack_redzone_size ;   1409    Int guest_stack_redzone_size ;
1410    Bool guest_amd64_assume_fs_is_zero ;   1410    Bool guest_amd64_assume_fs_is_zero ;
1411    Bool guest_amd64_assume_gs_is_0x60 ;   1411    Bool guest_amd64_assume_gs_is_0x60 ;
1412    Bool guest_ppc_zap_RZ_at_blr ;   1412    Bool guest_ppc_zap_RZ_at_blr ;
1413    Bool (*guest_ppc_zap_RZ_at_bl)(Addr64  ) ;   1413    Bool (*guest_ppc_zap_RZ_at_bl)(Addr64  ) ;
1414    Bool guest_ppc_sc_continues_at_LR ;   1414    Bool guest_ppc_sc_continues_at_LR ;
1415    Bool host_ppc_calls_use_fndescrs ;   1415    Bool host_ppc_calls_use_fndescrs ;
1416    Bool host_ppc32_regalign_int64_args ;   1416    Bool host_ppc32_regalign_int64_args ;
1417 };   1417 };
1418 typedef struct __anonstruct_VexAbiInfo_77 VexAbiInfo;   1418 typedef struct __anonstruct_VexAbiInfo_77 VexAbiInfo;
1419 struct __anonstruct_VexControl_78 {   1419 struct __anonstruct_VexControl_78 {
1420    Int iropt_verbosity ;   1420    Int iropt_verbosity ;
1421    Int iropt_level ;   1421    Int iropt_level ;
1422    Bool iropt_precise_memory_exns ;   1422    Bool iropt_precise_memory_exns ;
1423    Int iropt_unroll_thresh ;   1423    Int iropt_unroll_thresh ;
1424    Int guest_max_insns ;   1424    Int guest_max_insns ;
1425    Int guest_chase_thresh ;   1425    Int guest_chase_thresh ;
1426    Bool guest_chase_cond ;   1426    Bool guest_chase_cond ;
1427 };   1427 };
1428 typedef struct __anonstruct_VexControl_78 VexControl;   1428 typedef struct __anonstruct_VexControl_78 VexControl;
1429 union __anonunion_x_79 {   1429 union __anonunion_x_79 {
1430    char c ;   1430    char c ;
1431    short s ;   1431    short s ;
1432    int i ;   1432    int i ;
1433    long l ;   1433    long l ;
1434    long long ll ;   1434    long long ll ;
1435    float f ;   1435    float f ;
1436    double d ;   1436    double d ;
1437    void *pto ;   1437    void *pto ;
1438    void (*ptf)(void) ;   1438    void (*ptf)(void) ;
1439 };   1439 };
1440 struct align {   1440 struct align {
1441    char c ;   1441    char c ;
1442    union __anonunion_x_79 x ;   1442    union __anonunion_x_79 x ;
1443 };   1443 };
1444 struct __anonstruct_alwaysDefd_81 {   1444 struct __anonstruct_alwaysDefd_81 {
1445    Int offset ;   1445    Int offset ;
1446    Int size ;   1446    Int size ;
1447 };   1447 };
1448 struct __anonstruct_VexGuestLayout_80 {   1448 struct __anonstruct_VexGuestLayout_80 {
1449    Int total_sizeB ;   1449    Int total_sizeB ;
1450    Int offset_SP ;   1450    Int offset_SP ;
1451    Int sizeof_SP ;   1451    Int sizeof_SP ;
1452    Int offset_FP ;   1452    Int offset_FP ;
1453    Int sizeof_FP ;   1453    Int sizeof_FP ;
1454    Int offset_IP ;   1454    Int offset_IP ;
1455    Int sizeof_IP ;   1455    Int sizeof_IP ;
1456    Int n_alwaysDefd ;   1456    Int n_alwaysDefd ;
1457    struct __anonstruct_alwaysDefd_81 alwaysDefd[24] ;   1457    struct __anonstruct_alwaysDefd_81 alwaysDefd[24] ;
1458 };   1458 };
1459 typedef struct __anonstruct_VexGuestLayout_80 VexGuestLayout;   1459 typedef struct __anonstruct_VexGuestLayout_80 VexGuestLayout;
1460 enum __anonenum_status_83 {   1460 enum __anonenum_status_83 {
1461     VexTransOK = 0,   1461     VexTransOK = 0,
1462     VexTransAccessFail = 1,   1462     VexTransAccessFail = 1,
1463     VexTransOutputFull = 2   1463     VexTransOutputFull = 2
1464 } ;   1464 } ;
1465 struct __anonstruct_VexTranslateResult_82 {   1465 struct __anonstruct_VexTranslateResult_82 {
1466    enum __anonenum_status_83 status ;   1466    enum __anonenum_status_83 status ;
1467    UInt n_sc_extents ;   1467    UInt n_sc_extents ;
1468 };   1468 };
1469 typedef struct __anonstruct_VexTranslateResult_82 VexTranslateResult;   1469 typedef struct __anonstruct_VexTranslateResult_82 VexTranslateResult;
1470 struct __anonstruct_VexGuestExtents_84 {   1470 struct __anonstruct_VexGuestExtents_84 {
1471    Addr64 base[3] ;   1471    Addr64 base[3] ;
1472    UShort len[3] ;   1472    UShort len[3] ;
1473    UShort n_used ;   1473    UShort n_used ;
1474 };   1474 };
1475 typedef struct __anonstruct_VexGuestExtents_84 VexGuestExtents;   1475 typedef struct __anonstruct_VexGuestExtents_84 VexGuestExtents;
1476 struct __anonstruct_VexTranslateArgs_85 {   1476 struct __anonstruct_VexTranslateArgs_85 {
1477    VexArch arch_guest ;   1477    VexArch arch_guest ;
1478    VexArchInfo archinfo_guest ;   1478    VexArchInfo archinfo_guest ;
1479    VexArch arch_host ;   1479    VexArch arch_host ;
1480    VexArchInfo archinfo_host ;   1480    VexArchInfo archinfo_host ;
1481    VexAbiInfo abiinfo_both ;   1481    VexAbiInfo abiinfo_both ;
1482    void *callback_opaque ;   1482    void *callback_opaque ;
1483    UChar *guest_bytes ;   1483    UChar *guest_bytes ;
1484    Addr64 guest_bytes_addr ;   1484    Addr64 guest_bytes_addr ;
1485    Bool (*chase_into_ok)(void * , Addr64  ) ;   1485    Bool (*chase_into_ok)(void * , Addr64  ) ;
1486    VexGuestExtents *guest_extents ;   1486    VexGuestExtents *guest_extents ;
1487    UChar *host_bytes ;   1487    UChar *host_bytes ;
1488    Int host_bytes_size ;   1488    Int host_bytes_size ;
1489    Int *host_bytes_used ;   1489    Int *host_bytes_used ;
1490    IRSB *(*instrument1)(void * , IRSB * , VexGuestLayout * , VexGuestExtents * ,   1490    IRSB *(*instrument1)(void * , IRSB * , VexGuestLayout * , VexGuestExtents * ,
1491                         IRType gWordTy , IRType hWordTy ) ;   1491                         IRType gWordTy , IRType hWordTy ) ;
1492    IRSB *(*instrument2)(void * , IRSB * , VexGuestLayout * , VexGuestExtents * ,   1492    IRSB *(*instrument2)(void * , IRSB * , VexGuestLayout * , VexGuestExtents * ,
1493                         IRType gWordTy , IRType hWordTy ) ;   1493                         IRType gWordTy , IRType hWordTy ) ;
1494    IRSB *(*finaltidy)(IRSB * ) ;   1494    IRSB *(*finaltidy)(IRSB * ) ;
1495    UInt (*needs_self_check)(void * , VexGuestExtents * ) ;   1495    UInt (*needs_self_check)(void * , VexGuestExtents * ) ;
1496    Bool (*preamble_function)(void * , IRSB * ) ;   1496    Bool (*preamble_function)(void * , IRSB * ) ;
1497    Int traceflags ;   1497    Int traceflags ;
1498    void *dispatch_unassisted ;   1498    void *dispatch_unassisted ;
1499    void *dispatch_assisted ;   1499    void *dispatch_assisted ;
1500 };   1500 };
1501 typedef struct __anonstruct_VexTranslateArgs_85 VexTranslateArgs;   1501 typedef struct __anonstruct_VexTranslateArgs_85 VexTranslateArgs;
1502 struct __anonstruct_VgCallbackClosure_86 {   1502 struct __anonstruct_VgCallbackClosure_86 {
1503    Addr64 nraddr ;   1503    Addr64 nraddr ;
1504    Addr64 readdr ;   1504    Addr64 readdr ;
1505    ThreadId tid ;   1505    ThreadId tid ;
1506 };   1506 };
1507 typedef struct __anonstruct_VgCallbackClosure_86 VgCallbackClosure;   1507 typedef struct __anonstruct_VgCallbackClosure_86 VgCallbackClosure;
1508 enum __anonenum_CorePart_87 {   1508 enum __anonenum_CorePart_87 {
1509     Vg_CoreStartup = 1,   1509     Vg_CoreStartup = 1,
1510     Vg_CoreSignal = 2,   1510     Vg_CoreSignal = 2,
1511     Vg_CoreSysCall = 3,   1511     Vg_CoreSysCall = 3,
1512     Vg_CoreSysCallArgInMem = 4,   1512     Vg_CoreSysCallArgInMem = 4,
1513     Vg_CoreTranslate = 5,   1513     Vg_CoreTranslate = 5,
1514     Vg_CoreClientReq = 6   1514     Vg_CoreClientReq = 6
1515 } ;   1515 } ;
1516 typedef enum __anonenum_CorePart_87 CorePart;   1516 typedef enum __anonenum_CorePart_87 CorePart;
1517 struct __anonstruct_OrigFn_88 {   1517 struct __anonstruct_OrigFn_88 {
1518    unsigned int nraddr ;   1518    unsigned int nraddr ;
1519 };   1519 };
1520 typedef struct __anonstruct_OrigFn_88 OrigFn;   1520 typedef struct __anonstruct_OrigFn_88 OrigFn;
1521 enum __anonenum_Vg_ClientRequest_89 {   1521 enum __anonenum_Vg_ClientRequest_89 {
1522     VG_USERREQ__RUNNING_ON_VALGRIND = 4097,   1522     VG_USERREQ__RUNNING_ON_VALGRIND = 4097,
1523     VG_USERREQ__DISCARD_TRANSLATIONS = 4098,   1523     VG_USERREQ__DISCARD_TRANSLATIONS = 4098,
1524     VG_USERREQ__CLIENT_CALL0 = 4353,   1524     VG_USERREQ__CLIENT_CALL0 = 4353,
1525     VG_USERREQ__CLIENT_CALL1 = 4354,   1525     VG_USERREQ__CLIENT_CALL1 = 4354,
1526     VG_USERREQ__CLIENT_CALL2 = 4355,   1526     VG_USERREQ__CLIENT_CALL2 = 4355,
1527     VG_USERREQ__CLIENT_CALL3 = 4356,   1527     VG_USERREQ__CLIENT_CALL3 = 4356,
1528     VG_USERREQ__COUNT_ERRORS = 4609,   1528     VG_USERREQ__COUNT_ERRORS = 4609,
1529     VG_USERREQ__GDB_MONITOR_COMMAND = 4610,   1529     VG_USERREQ__GDB_MONITOR_COMMAND = 4610,
1530     VG_USERREQ__MALLOCLIKE_BLOCK = 4865,   1530     VG_USERREQ__MALLOCLIKE_BLOCK = 4865,
1531     VG_USERREQ__RESIZEINPLACE_BLOCK = 4875,   1531     VG_USERREQ__RESIZEINPLACE_BLOCK = 4875,
1532     VG_USERREQ__FREELIKE_BLOCK = 4866,   1532     VG_USERREQ__FREELIKE_BLOCK = 4866,
1533     VG_USERREQ__CREATE_MEMPOOL = 4867,   1533     VG_USERREQ__CREATE_MEMPOOL = 4867,
1534     VG_USERREQ__DESTROY_MEMPOOL = 4868,   1534     VG_USERREQ__DESTROY_MEMPOOL = 4868,
1535     VG_USERREQ__MEMPOOL_ALLOC = 4869,   1535     VG_USERREQ__MEMPOOL_ALLOC = 4869,
1536     VG_USERREQ__MEMPOOL_FREE = 4870,   1536     VG_USERREQ__MEMPOOL_FREE = 4870,
1537     VG_USERREQ__MEMPOOL_TRIM = 4871,   1537     VG_USERREQ__MEMPOOL_TRIM = 4871,
1538     VG_USERREQ__MOVE_MEMPOOL = 4872,   1538     VG_USERREQ__MOVE_MEMPOOL = 4872,
1539     VG_USERREQ__MEMPOOL_CHANGE = 4873,   1539     VG_USERREQ__MEMPOOL_CHANGE = 4873,
1540     VG_USERREQ__MEMPOOL_EXISTS = 4874,   1540     VG_USERREQ__MEMPOOL_EXISTS = 4874,
1541     VG_USERREQ__PRINTF = 5121,   1541     VG_USERREQ__PRINTF = 5121,
1542     VG_USERREQ__PRINTF_BACKTRACE = 5122,   1542     VG_USERREQ__PRINTF_BACKTRACE = 5122,
1543     VG_USERREQ__PRINTF_VALIST_BY_REF = 5123,   1543     VG_USERREQ__PRINTF_VALIST_BY_REF = 5123,
1544     VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF = 5124,   1544     VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF = 5124,
1545     VG_USERREQ__STACK_REGISTER = 5377,   1545     VG_USERREQ__STACK_REGISTER = 5377,
1546     VG_USERREQ__STACK_DEREGISTER = 5378,   1546     VG_USERREQ__STACK_DEREGISTER = 5378,
1547     VG_USERREQ__STACK_CHANGE = 5379,   1547     VG_USERREQ__STACK_CHANGE = 5379,
1548     VG_USERREQ__LOAD_PDB_DEBUGINFO = 5633,   1548     VG_USERREQ__LOAD_PDB_DEBUGINFO = 5633,
1549     VG_USERREQ__MAP_IP_TO_SRCLOC = 5889,   1549     VG_USERREQ__MAP_IP_TO_SRCLOC = 5889,
1550     VG_USERREQ__CHANGE_ERR_DISABLEMENT = 6145   1550     VG_USERREQ__CHANGE_ERR_DISABLEMENT = 6145
1551 } ;   1551 } ;
1552 typedef enum __anonenum_Vg_ClientRequest_89 Vg_ClientRequest;   1552 typedef enum __anonenum_Vg_ClientRequest_89 Vg_ClientRequest;
1553 enum __anonenum_90 {   1553 enum __anonenum_90 {
1554     VG_USERREQ__DRD_CLEAN_MEMORY = 1212612608,   1554     VG_USERREQ__DRD_CLEAN_MEMORY = 1212612608,
1555     VG_USERREQ__DRD_GET_VALGRIND_THREAD_ID = 1146224640,   1555     VG_USERREQ__DRD_GET_VALGRIND_THREAD_ID = 1146224640,
1556     VG_USERREQ__DRD_GET_DRD_THREAD_ID = 1146224641,   1556     VG_USERREQ__DRD_GET_DRD_THREAD_ID = 1146224641,
1557     VG_USERREQ__DRD_START_SUPPRESSION = 1146224642,   1557     VG_USERREQ__DRD_START_SUPPRESSION = 1146224642,
1558     VG_USERREQ__DRD_FINISH_SUPPRESSION = 1146224643,   1558     VG_USERREQ__DRD_FINISH_SUPPRESSION = 1146224643,
1559     VG_USERREQ__DRD_START_TRACE_ADDR = 1146224644,   1559     VG_USERREQ__DRD_START_TRACE_ADDR = 1146224644,
1560     VG_USERREQ__DRD_STOP_TRACE_ADDR = 1146224645,   1560     VG_USERREQ__DRD_STOP_TRACE_ADDR = 1146224645,
1561     VG_USERREQ__DRD_RECORD_LOADS = 1146224646,   1561     VG_USERREQ__DRD_RECORD_LOADS = 1146224646,
1562     VG_USERREQ__DRD_RECORD_STORES = 1146224647,   1562     VG_USERREQ__DRD_RECORD_STORES = 1146224647,
1563     VG_USERREQ__DRD_SET_THREAD_NAME = 1146224648,   1563     VG_USERREQ__DRD_SET_THREAD_NAME = 1146224648,
1564     VG_USERREQ__DRD_ANNOTATION_UNIMP = 1146224649,   1564     VG_USERREQ__DRD_ANNOTATION_UNIMP = 1146224649,
1565     VG_USERREQ__DRD_ANNOTATE_RWLOCK_CREATE = 1212612878,   1565     VG_USERREQ__DRD_ANNOTATE_RWLOCK_CREATE = 1212612878,
1566     VG_USERREQ__DRD_ANNOTATE_RWLOCK_DESTROY = 1212612879,   1566     VG_USERREQ__DRD_ANNOTATE_RWLOCK_DESTROY = 1212612879,
1567     VG_USERREQ__DRD_ANNOTATE_RWLOCK_ACQUIRED = 1212612881,   1567     VG_USERREQ__DRD_ANNOTATE_RWLOCK_ACQUIRED = 1212612881,
1568     VG_USERREQ__DRD_ANNOTATE_RWLOCK_RELEASED = 1212612882,   1568     VG_USERREQ__DRD_ANNOTATE_RWLOCK_RELEASED = 1212612882,
1569     VG_USERREQ__HELGRIND_ANNOTATION_UNIMP = 1212612896,   1569     VG_USERREQ__HELGRIND_ANNOTATION_UNIMP = 1212612896,
1570     VG_USERREQ__DRD_ANNOTATE_HAPPENS_BEFORE = 1212612897,   1570     VG_USERREQ__DRD_ANNOTATE_HAPPENS_BEFORE = 1212612897,
1571     VG_USERREQ__DRD_ANNOTATE_HAPPENS_AFTER = 1212612898   1571     VG_USERREQ__DRD_ANNOTATE_HAPPENS_AFTER = 1212612898
1572 } ;   1572 } ;
1573 enum __anonenum_91 {   1573 enum __anonenum_91 {
1574     VG_USERREQ__SET_PTHREAD_COND_INITIALIZER = 1148321792,   1574     VG_USERREQ__SET_PTHREAD_COND_INITIALIZER = 1148321792,
1575     VG_USERREQ__DRD_START_NEW_SEGMENT = 1148321793,   1575     VG_USERREQ__DRD_START_NEW_SEGMENT = 1148321793,
1576     VG_USERREQ__SET_PTHREADID = 1148321794,   1576     VG_USERREQ__SET_PTHREADID = 1148321794,
1577     VG_USERREQ__SET_JOINABLE = 1148321795,   1577     VG_USERREQ__SET_JOINABLE = 1148321795,
1578     VG_USERREQ__ENTERING_PTHREAD_CREATE = 1148321796,   1578     VG_USERREQ__ENTERING_PTHREAD_CREATE = 1148321796,
1579     VG_USERREQ__LEFT_PTHREAD_CREATE = 1148321797,   1579     VG_USERREQ__LEFT_PTHREAD_CREATE = 1148321797,
1580     VG_USERREQ__POST_THREAD_JOIN = 1148321798,   1580     VG_USERREQ__POST_THREAD_JOIN = 1148321798,
1581     VG_USERREQ__PRE_THREAD_CANCEL = 1148321799,   1581     VG_USERREQ__PRE_THREAD_CANCEL = 1148321799,
1582     VG_USERREQ__POST_THREAD_CANCEL = 1148321800,   1582     VG_USERREQ__POST_THREAD_CANCEL = 1148321800,
1583     VG_USERREQ__PRE_MUTEX_INIT = 1148321801,   1583     VG_USERREQ__PRE_MUTEX_INIT = 1148321801,
1584     VG_USERREQ__POST_MUTEX_INIT = 1148321802,   1584     VG_USERREQ__POST_MUTEX_INIT = 1148321802,
1585     VG_USERREQ__PRE_MUTEX_DESTROY = 1148321803,   1585     VG_USERREQ__PRE_MUTEX_DESTROY = 1148321803,
1586     VG_USERREQ__POST_MUTEX_DESTROY = 1148321804,   1586     VG_USERREQ__POST_MUTEX_DESTROY = 1148321804,
1587     VG_USERREQ__PRE_MUTEX_LOCK = 1148321805,   1587     VG_USERREQ__PRE_MUTEX_LOCK = 1148321805,
1588     VG_USERREQ__POST_MUTEX_LOCK = 1148321806,   1588     VG_USERREQ__POST_MUTEX_LOCK = 1148321806,
1589     VG_USERREQ__PRE_MUTEX_UNLOCK = 1148321807,   1589     VG_USERREQ__PRE_MUTEX_UNLOCK = 1148321807,
1590     VG_USERREQ__POST_MUTEX_UNLOCK = 1148321808,   1590     VG_USERREQ__POST_MUTEX_UNLOCK = 1148321808,
1591     VG_USERREQ__PRE_SPIN_INIT_OR_UNLOCK = 1148321809,   1591     VG_USERREQ__PRE_SPIN_INIT_OR_UNLOCK = 1148321809,
1592     VG_USERREQ__POST_SPIN_INIT_OR_UNLOCK = 1148321810,   1592     VG_USERREQ__POST_SPIN_INIT_OR_UNLOCK = 1148321810,
1593     VG_USERREQ__PRE_COND_INIT = 1148321811,   1593     VG_USERREQ__PRE_COND_INIT = 1148321811,
1594     VG_USERREQ__POST_COND_INIT = 1148321812,   1594     VG_USERREQ__POST_COND_INIT = 1148321812,
1595     VG_USERREQ__PRE_COND_DESTROY = 1148321813,   1595     VG_USERREQ__PRE_COND_DESTROY = 1148321813,
1596     VG_USERREQ__POST_COND_DESTROY = 1148321814,   1596     VG_USERREQ__POST_COND_DESTROY = 1148321814,
1597     VG_USERREQ__PRE_COND_WAIT = 1148321815,   1597     VG_USERREQ__PRE_COND_WAIT = 1148321815,
1598     VG_USERREQ__POST_COND_WAIT = 1148321816,   1598     VG_USERREQ__POST_COND_WAIT = 1148321816,
1599     VG_USERREQ__PRE_COND_SIGNAL = 1148321817,   1599     VG_USERREQ__PRE_COND_SIGNAL = 1148321817,
1600     VG_USERREQ__POST_COND_SIGNAL = 1148321818,   1600     VG_USERREQ__POST_COND_SIGNAL = 1148321818,
1601     VG_USERREQ__PRE_COND_BROADCAST = 1148321819,   1601     VG_USERREQ__PRE_COND_BROADCAST = 1148321819,
1602     VG_USERREQ__POST_COND_BROADCAST = 1148321820,   1602     VG_USERREQ__POST_COND_BROADCAST = 1148321820,
1603     VG_USERREQ__PRE_SEM_INIT = 1148321821,   1603     VG_USERREQ__PRE_SEM_INIT = 1148321821,
1604     VG_USERREQ__POST_SEM_INIT = 1148321822,   1604     VG_USERREQ__POST_SEM_INIT = 1148321822,
1605     VG_USERREQ__PRE_SEM_DESTROY = 1148321823,   1605     VG_USERREQ__PRE_SEM_DESTROY = 1148321823,
1606     VG_USERREQ__POST_SEM_DESTROY = 1148321824,   1606     VG_USERREQ__POST_SEM_DESTROY = 1148321824,
1607     VG_USERREQ__PRE_SEM_OPEN = 1148321825,   1607     VG_USERREQ__PRE_SEM_OPEN = 1148321825,
1608     VG_USERREQ__POST_SEM_OPEN = 1148321826,   1608     VG_USERREQ__POST_SEM_OPEN = 1148321826,
1609     VG_USERREQ__PRE_SEM_CLOSE = 1148321827,   1609     VG_USERREQ__PRE_SEM_CLOSE = 1148321827,
1610     VG_USERREQ__POST_SEM_CLOSE = 1148321828,   1610     VG_USERREQ__POST_SEM_CLOSE = 1148321828,
1611     VG_USERREQ__PRE_SEM_WAIT = 1148321829,   1611     VG_USERREQ__PRE_SEM_WAIT = 1148321829,
1612     VG_USERREQ__POST_SEM_WAIT = 1148321830,   1612     VG_USERREQ__POST_SEM_WAIT = 1148321830,
1613     VG_USERREQ__PRE_SEM_POST = 1148321831,   1613     VG_USERREQ__PRE_SEM_POST = 1148321831,
1614     VG_USERREQ__POST_SEM_POST = 1148321832,   1614     VG_USERREQ__POST_SEM_POST = 1148321832,
1615     VG_USERREQ__PRE_BARRIER_INIT = 1148321833,   1615     VG_USERREQ__PRE_BARRIER_INIT = 1148321833,
1616     VG_USERREQ__POST_BARRIER_INIT = 1148321834,   1616     VG_USERREQ__POST_BARRIER_INIT = 1148321834,
1617     VG_USERREQ__PRE_BARRIER_DESTROY = 1148321835,   1617     VG_USERREQ__PRE_BARRIER_DESTROY = 1148321835,
1618     VG_USERREQ__POST_BARRIER_DESTROY = 1148321836,   1618     VG_USERREQ__POST_BARRIER_DESTROY = 1148321836,
1619     VG_USERREQ__PRE_BARRIER_WAIT = 1148321837,   1619     VG_USERREQ__PRE_BARRIER_WAIT = 1148321837,
1620     VG_USERREQ__POST_BARRIER_WAIT = 1148321838,   1620     VG_USERREQ__POST_BARRIER_WAIT = 1148321838,
1621     VG_USERREQ__PRE_RWLOCK_INIT = 1148321839,   1621     VG_USERREQ__PRE_RWLOCK_INIT = 1148321839,
1622     VG_USERREQ__POST_RWLOCK_DESTROY = 1148321840,   1622     VG_USERREQ__POST_RWLOCK_DESTROY = 1148321840,
1623     VG_USERREQ__PRE_RWLOCK_RDLOCK = 1148321841,   1623     VG_USERREQ__PRE_RWLOCK_RDLOCK = 1148321841,
1624     VG_USERREQ__POST_RWLOCK_RDLOCK = 1148321842,   1624     VG_USERREQ__POST_RWLOCK_RDLOCK = 1148321842,
1625     VG_USERREQ__PRE_RWLOCK_WRLOCK = 1148321843,   1625     VG_USERREQ__PRE_RWLOCK_WRLOCK = 1148321843,
1626     VG_USERREQ__POST_RWLOCK_WRLOCK = 1148321844,   1626     VG_USERREQ__POST_RWLOCK_WRLOCK = 1148321844,
1627     VG_USERREQ__PRE_RWLOCK_UNLOCK = 1148321845,   1627     VG_USERREQ__PRE_RWLOCK_UNLOCK = 1148321845,
1628     VG_USERREQ__POST_RWLOCK_UNLOCK = 1148321846   1628     VG_USERREQ__POST_RWLOCK_UNLOCK = 1148321846
1629 } ;   1629 } ;
1630 enum __anonenum_MutexT_92 {   1630 enum __anonenum_MutexT_92 {
1631     mutex_type_unknown = -1,   1631     mutex_type_unknown = -1,
1632     mutex_type_invalid_mutex = 0,   1632     mutex_type_invalid_mutex = 0,
1633     mutex_type_recursive_mutex = 1,   1633     mutex_type_recursive_mutex = 1,
1634     mutex_type_errorcheck_mutex = 2,   1634     mutex_type_errorcheck_mutex = 2,
1635     mutex_type_default_mutex = 3,   1635     mutex_type_default_mutex = 3,
1636     mutex_type_spinlock = 4   1636     mutex_type_spinlock = 4
1637 } ;   1637 } ;
1638 typedef enum __anonenum_MutexT_92 MutexT;   1638 typedef enum __anonenum_MutexT_92 MutexT;
1639 enum __anonenum_RwLockT_93 {   1639 enum __anonenum_RwLockT_93 {
1640     pthread_rwlock = 1,   1640     pthread_rwlock = 1,
1641     user_rwlock = 2   1641     user_rwlock = 2
1642 } ;   1642 } ;
1643 typedef enum __anonenum_RwLockT_93 RwLockT;   1643 typedef enum __anonenum_RwLockT_93 RwLockT;
1644 enum __anonenum_BarrierT_94 {   1644 enum __anonenum_BarrierT_94 {
1645     pthread_barrier = 1,   1645     pthread_barrier = 1,
1646     gomp_barrier = 2   1646     gomp_barrier = 2
1647 } ;   1647 } ;
1648 typedef enum __anonenum_BarrierT_94 BarrierT;   1648 typedef enum __anonenum_BarrierT_94 BarrierT;
1649 struct barrier_info;   1649 struct barrier_info;
1650 struct barrier_info;   1650 struct barrier_info;
1651 struct _XArray;   1651 struct _XArray;
1652 typedef struct _XArray XArray;   1652 typedef struct _XArray XArray;
1653 union drd_clientobj;   1653 union drd_clientobj;
1654 union drd_clientobj;   1654 union drd_clientobj;
1655 enum __anonenum_ObjType_95 {   1655 enum __anonenum_ObjType_95 {
1656     ClientMutex = 1,   1656     ClientMutex = 1,
1657     ClientCondvar = 2,   1657     ClientCondvar = 2,
1658     ClientHbvar = 3,   1658     ClientHbvar = 3,
1659     ClientSemaphore = 4,   1659     ClientSemaphore = 4,
1660     ClientBarrier = 5,   1660     ClientBarrier = 5,
1661     ClientRwlock = 6   1661     ClientRwlock = 6
1662 } ;   1662 } ;
1663 typedef enum __anonenum_ObjType_95 ObjType;   1663 typedef enum __anonenum_ObjType_95 ObjType;
1664 struct any {   1664 struct any {
1665    Addr a1 ;   1665    Addr a1 ;
1666    ObjType type ;   1666    ObjType type ;
1667    void (*cleanup)(union drd_clientobj * ) ;   1667    void (*cleanup)(union drd_clientobj * ) ;
1668    void (*delete_thread)(union drd_clientobj * , DrdThreadId  ) ;   1668    void (*delete_thread)(union drd_clientobj * , DrdThreadId  ) ;
1669    ExeContext *first_observed_at ;   1669    ExeContext *first_observed_at ;
1670 };   1670 };
1671 struct mutex_info {   1671 struct mutex_info {
1672    Addr a1 ;   1672    Addr a1 ;
1673    ObjType type ;   1673    ObjType type ;
1674    void (*cleanup)(union drd_clientobj * ) ;   1674    void (*cleanup)(union drd_clientobj * ) ;
1675    void (*delete_thread)(union drd_clientobj * , DrdThreadId  ) ;   1675    void (*delete_thread)(union drd_clientobj * , DrdThreadId  ) ;
1676    ExeContext *first_observed_at ;   1676    ExeContext *first_observed_at ;
1677    MutexT mutex_type ;   1677    MutexT mutex_type ;
1678    int recursion_count ;   1678    int recursion_count ;
1679    DrdThreadId owner ;   1679    DrdThreadId owner ;
1680    struct segment *last_locked_segment ;   1680    struct segment *last_locked_segment ;
1681    ULong acquiry_time_ms ;   1681    ULong acquiry_time_ms ;
1682    ExeContext *acquired_at ;   1682    ExeContext *acquired_at ;
1683 };   1683 };
1684 struct cond_info {   1684 struct cond_info {
1685    Addr a1 ;   1685    Addr a1 ;
1686    ObjType type ;   1686    ObjType type ;
1687    void (*cleanup)(union drd_clientobj * ) ;   1687    void (*cleanup)(union drd_clientobj * ) ;
1688    void (*delete_thread)(union drd_clientobj * , DrdThreadId  ) ;   1688    void (*delete_thread)(union drd_clientobj * , DrdThreadId  ) ;
1689    ExeContext *first_observed_at ;   1689    ExeContext *first_observed_at ;
1690    int waiter_count ;   1690    int waiter_count ;
1691    Addr mutex ;   1691    Addr mutex ;
1692 };   1692 };
1693 struct hb_info {   1693 struct hb_info {
1694    Addr a1 ;   1694    Addr a1 ;
1695    ObjType type ;   1695    ObjType type ;
1696    void (*cleanup)(union drd_clientobj * ) ;   1696    void (*cleanup)(union drd_clientobj * ) ;
1697    void (*delete_thread)(union drd_clientobj * , DrdThreadId  ) ;   1697    void (*delete_thread)(union drd_clientobj * , DrdThreadId  ) ;
1698    ExeContext *first_observed_at ;   1698    ExeContext *first_observed_at ;
1699    OSet *oset ;   1699    OSet *oset ;
1700 };   1700 };
1701 struct semaphore_info {   1701 struct semaphore_info {
1702    Addr a1 ;   1702    Addr a1 ;
1703    ObjType type ;   1703    ObjType type ;
1704    void (*cleanup)(union drd_clientobj * ) ;   1704    void (*cleanup)(union drd_clientobj * ) ;
1705    void (*delete_thread)(union drd_clientobj * , DrdThreadId  ) ;   1705    void (*delete_thread)(union drd_clientobj * , DrdThreadId  ) ;
1706    ExeContext *first_observed_at ;   1706    ExeContext *first_observed_at ;
1707    UInt waits_to_skip ;   1707    UInt waits_to_skip ;
1708    UInt value ;   1708    UInt value ;
1709    UWord waiters ;   1709    UWord waiters ;
1710    DrdThreadId last_sem_post_tid ;   1710    DrdThreadId last_sem_post_tid ;
1711    XArray *last_sem_post_seg ;   1711    XArray *last_sem_post_seg ;
1712 };   1712 };
1713 struct barrier_info {   1713 struct barrier_info {
1714    Addr a1 ;   1714    Addr a1 ;
1715    ObjType type ;   1715    ObjType type ;
1716    void (*cleanup)(union drd_clientobj * ) ;   1716    void (*cleanup)(union drd_clientobj * ) ;
1717    void (*delete_thread)(union drd_clientobj * , DrdThreadId  ) ;   1717    void (*delete_thread)(union drd_clientobj * , DrdThreadId  ) ;
1718    ExeContext *first_observed_at ;   1718    ExeContext *first_observed_at ;
1719    BarrierT barrier_type ;   1719    BarrierT barrier_type ;
1720    Word count ;   1720    Word count ;
1721    Word pre_iteration ;   1721    Word pre_iteration ;
1722    Word post_iteration ;   1722    Word post_iteration ;
1723    Word pre_waiters_left ;   1723    Word pre_waiters_left ;
1724    Word post_waiters_left ;   1724    Word post_waiters_left ;
1725    OSet *oset[2] ;   1725    OSet *oset[2] ;
1726 };   1726 };
1727 struct rwlock_info {   1727 struct rwlock_info {
1728    Addr a1 ;   1728    Addr a1 ;
1729    ObjType type ;   1729    ObjType type ;
1730    void (*cleanup)(union drd_clientobj * ) ;   1730    void (*cleanup)(union drd_clientobj * ) ;
1731    void (*delete_thread)(union drd_clientobj * , DrdThreadId  ) ;   1731    void (*delete_thread)(union drd_clientobj * , DrdThreadId  ) ;
1732    ExeContext *first_observed_at ;   1732    ExeContext *first_observed_at ;
1733    RwLockT rwlock_type ;   1733    RwLockT rwlock_type ;
1734    OSet *thread_info ;   1734    OSet *thread_info ;
1735    ULong acquiry_time_ms ;   1735    ULong acquiry_time_ms ;
1736    ExeContext *acquired_at ;   1736    ExeContext *acquired_at ;
1737 };   1737 };
1738 union drd_clientobj {   1738 union drd_clientobj {
1739    struct any any ;   1739    struct any any ;
1740    struct mutex_info mutex ;   1740    struct mutex_info mutex ;
1741    struct cond_info cond ;   1741    struct cond_info cond ;
1742    struct hb_info hb ;   1742    struct hb_info hb ;
1743    struct semaphore_info semaphore ;   1743    struct semaphore_info semaphore ;
1744    struct barrier_info barrier ;   1744    struct barrier_info barrier ;
1745    struct rwlock_info rwlock ;   1745    struct rwlock_info rwlock ;
1746 };   1746 };
1747 typedef union drd_clientobj DrdClientobj;   1747 typedef union drd_clientobj DrdClientobj;
1748 struct cond_info;   1748 struct cond_info;
1749 struct mutex_info;   1749 struct mutex_info;
1750 struct semaphore_info;   1750 struct semaphore_info;
1751 typedef unsigned short __vki_kernel_mode_t;   1751 typedef unsigned short __vki_kernel_mode_t;
1752 typedef long __vki_kernel_off_t;   1752 typedef long __vki_kernel_off_t;
1753 typedef int __vki_kernel_pid_t;   1753 typedef int __vki_kernel_pid_t;
1754 typedef unsigned short __vki_kernel_ipc_pid_t;   1754 typedef unsigned short __vki_kernel_ipc_pid_t;
1755 typedef unsigned short __vki_kernel_uid_t;   1755 typedef unsigned short __vki_kernel_uid_t;
1756 typedef unsigned short __vki_kernel_gid_t;   1756 typedef unsigned short __vki_kernel_gid_t;
1757 typedef unsigned int __vki_kernel_size_t;   1757 typedef unsigned int __vki_kernel_size_t;
1758 typedef long __vki_kernel_time_t;   1758 typedef long __vki_kernel_time_t;
1759 typedef long __vki_kernel_suseconds_t;   1759 typedef long __vki_kernel_suseconds_t;
1760 typedef long __vki_kernel_clock_t;   1760 typedef long __vki_kernel_clock_t;
1761 typedef int __vki_kernel_timer_t;   1761 typedef int __vki_kernel_timer_t;
1762 typedef int __vki_kernel_clockid_t;   1762 typedef int __vki_kernel_clockid_t;
1763 typedef char *__vki_kernel_caddr_t;   1763 typedef char *__vki_kernel_caddr_t;
1764 typedef unsigned int __vki_kernel_uid32_t;   1764 typedef unsigned int __vki_kernel_uid32_t;
1765 typedef unsigned int __vki_kernel_gid32_t;   1765 typedef unsigned int __vki_kernel_gid32_t;
1766 typedef unsigned short __vki_kernel_old_uid_t;   1766 typedef unsigned short __vki_kernel_old_uid_t;
1767 typedef unsigned short __vki_kernel_old_gid_t;   1767 typedef unsigned short __vki_kernel_old_gid_t;
1768 typedef long long __vki_kernel_loff_t;   1768 typedef long long __vki_kernel_loff_t;
1769 struct __anonstruct___vki_kernel_fsid_t_96 {   1769 struct __anonstruct___vki_kernel_fsid_t_96 {
1770    int val[2] ;   1770    int val[2] ;
1771 };   1771 };
1772 typedef struct __anonstruct___vki_kernel_fsid_t_96 __vki_kernel_fsid_t;   1772 typedef struct __anonstruct___vki_kernel_fsid_t_96 __vki_kernel_fsid_t;
1773 struct __anonstruct___vki_kernel_fd_set_97 {   1773 struct __anonstruct___vki_kernel_fd_set_97 {
1774    unsigned long fds_bits[1024U / (8U * sizeof(unsigned long ))] ;   1774    unsigned long fds_bits[1024U / (8U * sizeof(unsigned long ))] ;
1775 };   1775 };
1776 typedef struct __anonstruct___vki_kernel_fd_set_97 __vki_kernel_fd_set;   1776 typedef struct __anonstruct___vki_kernel_fd_set_97 __vki_kernel_fd_set;
1777 typedef int __vki_kernel_key_t;   1777 typedef int __vki_kernel_key_t;
1778 typedef int __vki_kernel_mqd_t;   1778 typedef int __vki_kernel_mqd_t;
1779 typedef __vki_kernel_fd_set vki_fd_set;   1779 typedef __vki_kernel_fd_set vki_fd_set;
1780 typedef __vki_kernel_mode_t vki_mode_t;   1780 typedef __vki_kernel_mode_t vki_mode_t;
1781 typedef __vki_kernel_off_t vki_off_t;   1781 typedef __vki_kernel_off_t vki_off_t;
1782 typedef __vki_kernel_pid_t vki_pid_t;   1782 typedef __vki_kernel_pid_t vki_pid_t;
1783 typedef __vki_kernel_key_t vki_key_t;   1783 typedef __vki_kernel_key_t vki_key_t;
1784 typedef __vki_kernel_suseconds_t vki_suseconds_t;   1784 typedef __vki_kernel_suseconds_t vki_suseconds_t;
1785 typedef __vki_kernel_timer_t vki_timer_t;   1785 typedef __vki_kernel_timer_t vki_timer_t;
1786 typedef __vki_kernel_clockid_t vki_clockid_t;   1786 typedef __vki_kernel_clockid_t vki_clockid_t;
1787 typedef __vki_kernel_mqd_t vki_mqd_t;   1787 typedef __vki_kernel_mqd_t vki_mqd_t;
1788 typedef __vki_kernel_uid32_t vki_uid_t;   1788 typedef __vki_kernel_uid32_t vki_uid_t;
1789 typedef __vki_kernel_gid32_t vki_gid_t;   1789 typedef __vki_kernel_gid32_t vki_gid_t;
1790 typedef __vki_kernel_old_uid_t vki_old_uid_t;   1790 typedef __vki_kernel_old_uid_t vki_old_uid_t;
1791 typedef __vki_kernel_old_gid_t vki_old_gid_t;   1791 typedef __vki_kernel_old_gid_t vki_old_gid_t;
1792 typedef __vki_kernel_loff_t vki_loff_t;   1792 typedef __vki_kernel_loff_t vki_loff_t;
1793 typedef __vki_kernel_size_t vki_size_t;   1793 typedef __vki_kernel_size_t vki_size_t;
1794 typedef __vki_kernel_time_t vki_time_t;   1794 typedef __vki_kernel_time_t vki_time_t;
1795 typedef __vki_kernel_clock_t vki_clock_t;   1795 typedef __vki_kernel_clock_t vki_clock_t;
1796 typedef __vki_kernel_caddr_t vki_caddr_t;   1796 typedef __vki_kernel_caddr_t vki_caddr_t;
1797 typedef unsigned long vki_u_long;   1797 typedef unsigned long vki_u_long;
1798 typedef unsigned int vki_uint;   1798 typedef unsigned int vki_uint;
1799 typedef unsigned char __vki_u8;   1799 typedef unsigned char __vki_u8;
1800 typedef short __vki_s16;   1800 typedef short __vki_s16;
1801 typedef unsigned short __vki_u16;   1801 typedef unsigned short __vki_u16;
1802 typedef int __vki_s32;   1802 typedef int __vki_s32;
1803 typedef unsigned int __vki_u32;   1803 typedef unsigned int __vki_u32;
1804 typedef long long __vki_s64;   1804 typedef long long __vki_s64;
1805 typedef unsigned long long __vki_u64;   1805 typedef unsigned long long __vki_u64;
1806 typedef unsigned short vki_u16;   1806 typedef unsigned short vki_u16;
1807 typedef unsigned int vki_u32;   1807 typedef unsigned int vki_u32;
1808 typedef void __vki_signalfn_t(int  );   1808 typedef void __vki_signalfn_t(int  );
1809 typedef __vki_signalfn_t *__vki_sighandler_t;   1809 typedef __vki_signalfn_t *__vki_sighandler_t;
1810 typedef void __vki_restorefn_t(void);   1810 typedef void __vki_restorefn_t(void);
1811 typedef __vki_restorefn_t *__vki_sigrestore_t;   1811 typedef __vki_restorefn_t *__vki_sigrestore_t;
1812 typedef unsigned long vki_old_sigset_t;   1812 typedef unsigned long vki_old_sigset_t;
1813 struct __anonstruct_vki_sigset_t_98 {   1813 struct __anonstruct_vki_sigset_t_98 {
1814    unsigned long sig[2] ;   1814    unsigned long sig[2] ;
1815 };   1815 };
1816 typedef struct __anonstruct_vki_sigset_t_98 vki_sigset_t;   1816 typedef struct __anonstruct_vki_sigset_t_98 vki_sigset_t;
1817 struct vki_old_sigaction {   1817 struct vki_old_sigaction {
1818    __vki_sighandler_t ksa_handler ;   1818    __vki_sighandler_t ksa_handler ;
1819    vki_old_sigset_t sa_mask ;   1819    vki_old_sigset_t sa_mask ;
1820    unsigned long sa_flags ;   1820    unsigned long sa_flags ;
1821    __vki_sigrestore_t sa_restorer ;   1821    __vki_sigrestore_t sa_restorer ;
1822 };   1822 };
1823 struct vki_sigaction_base {   1823 struct vki_sigaction_base {
1824    __vki_sighandler_t ksa_handler ;   1824    __vki_sighandler_t ksa_handler ;
1825    unsigned long sa_flags ;   1825    unsigned long sa_flags ;
1826    __vki_sigrestore_t sa_restorer ;   1826    __vki_sigrestore_t sa_restorer ;
1827    vki_sigset_t sa_mask ;   1827    vki_sigset_t sa_mask ;
1828 };   1828 };
1829 typedef struct vki_sigaction_base vki_sigaction_toK_t;   1829 typedef struct vki_sigaction_base vki_sigaction_toK_t;
1830 typedef struct vki_sigaction_base vki_sigaction_fromK_t;   1830 typedef struct vki_sigaction_base vki_sigaction_fromK_t;
1831 struct vki_sigaltstack {   1831 struct vki_sigaltstack {
1832    void *ss_sp ;   1832    void *ss_sp ;
1833    int ss_flags ;   1833    int ss_flags ;
1834    vki_size_t ss_size ;   1834    vki_size_t ss_size ;
1835 };   1835 };
1836 typedef struct vki_sigaltstack vki_stack_t;   1836 typedef struct vki_sigaltstack vki_stack_t;
1837 struct _vki_fpreg {   1837 struct _vki_fpreg {
1838    unsigned short significand[4] ;   1838    unsigned short significand[4] ;
1839    unsigned short exponent ;   1839    unsigned short exponent ;
1840 };   1840 };
1841 struct _vki_fpxreg {   1841 struct _vki_fpxreg {
1842    unsigned short significand[4] ;   1842    unsigned short significand[4] ;
1843    unsigned short exponent ;   1843    unsigned short exponent ;
1844    unsigned short padding[3] ;   1844    unsigned short padding[3] ;
1845 };   1845 };
1846 struct _vki_xmmreg {   1846 struct _vki_xmmreg {
1847    unsigned long element[4] ;   1847    unsigned long element[4] ;
1848 };   1848 };
1849 struct _vki_fpstate {   1849 struct _vki_fpstate {
1850    unsigned long cw ;   1850    unsigned long cw ;
1851    unsigned long sw ;   1851    unsigned long sw ;
1852    unsigned long tag ;   1852    unsigned long tag ;
1853    unsigned long ipoff ;   1853    unsigned long ipoff ;
1854    unsigned long cssel ;   1854    unsigned long cssel ;
1855    unsigned long dataoff ;   1855    unsigned long dataoff ;
1856    unsigned long datasel ;   1856    unsigned long datasel ;
1857    struct _vki_fpreg _st[8] ;   1857    struct _vki_fpreg _st[8] ;
1858    unsigned short status ;   1858    unsigned short status ;
1859    unsigned short magic ;   1859    unsigned short magic ;
1860    unsigned long _fxsr_env[6] ;   1860    unsigned long _fxsr_env[6] ;
1861    unsigned long mxcsr ;   1861    unsigned long mxcsr ;
1862    unsigned long reserved ;   1862    unsigned long reserved ;
1863    struct _vki_fpxreg _fxsr_st[8] ;   1863    struct _vki_fpxreg _fxsr_st[8] ;
1864    struct _vki_xmmreg _xmm[8] ;   1864    struct _vki_xmmreg _xmm[8] ;
1865    unsigned long padding[56] ;   1865    unsigned long padding[56] ;
1866 };   1866 };
1867 struct vki_sigcontext {   1867 struct vki_sigcontext {
1868    unsigned short gs ;   1868    unsigned short gs ;
1869    unsigned short __gsh ;   1869    unsigned short __gsh ;
1870    unsigned short fs ;   1870    unsigned short fs ;
1871    unsigned short __fsh ;   1871    unsigned short __fsh ;
1872    unsigned short es ;   1872    unsigned short es ;
1873    unsigned short __esh ;   1873    unsigned short __esh ;
1874    unsigned short ds ;   1874    unsigned short ds ;
1875    unsigned short __dsh ;   1875    unsigned short __dsh ;
1876    unsigned long edi ;   1876    unsigned long edi ;
1877    unsigned long esi ;   1877    unsigned long esi ;
1878    unsigned long ebp ;   1878    unsigned long ebp ;
1879    unsigned long esp ;   1879    unsigned long esp ;
1880    unsigned long ebx ;   1880    unsigned long ebx ;
1881    unsigned long edx ;   1881    unsigned long edx ;
1882    unsigned long ecx ;   1882    unsigned long ecx ;
1883    unsigned long eax ;   1883    unsigned long eax ;
1884    unsigned long trapno ;   1884    unsigned long trapno ;
1885    unsigned long err ;   1885    unsigned long err ;
1886    unsigned long eip ;   1886    unsigned long eip ;
1887    unsigned short cs ;   1887    unsigned short cs ;
1888    unsigned short __csh ;   1888    unsigned short __csh ;
1889    unsigned long eflags ;   1889    unsigned long eflags ;
1890    unsigned long esp_at_signal ;   1890    unsigned long esp_at_signal ;
1891    unsigned short ss ;   1891    unsigned short ss ;
1892    unsigned short __ssh ;   1892    unsigned short __ssh ;
1893    struct _vki_fpstate *fpstate ;   1893    struct _vki_fpstate *fpstate ;
1894    unsigned long oldmask ;   1894    unsigned long oldmask ;
1895    unsigned long cr2 ;   1895    unsigned long cr2 ;
1896 };   1896 };
1897 struct vki_f_owner_ex {   1897 struct vki_f_owner_ex {
1898    int type ;   1898    int type ;
1899    __vki_kernel_pid_t pid ;   1899    __vki_kernel_pid_t pid ;
1900 };   1900 };
1901 struct vki_stat {   1901 struct vki_stat {
1902    unsigned long st_dev ;   1902    unsigned long st_dev ;
1903    unsigned long st_ino ;   1903    unsigned long st_ino ;
1904    unsigned short st_mode ;   1904    unsigned short st_mode ;
1905    unsigned short st_nlink ;   1905    unsigned short st_nlink ;
1906    unsigned short st_uid ;   1906    unsigned short st_uid ;
1907    unsigned short st_gid ;   1907    unsigned short st_gid ;
1908    unsigned long st_rdev ;   1908    unsigned long st_rdev ;
1909    unsigned long st_size ;   1909    unsigned long st_size ;
1910    unsigned long st_blksize ;   1910    unsigned long st_blksize ;
1911    unsigned long st_blocks ;   1911    unsigned long st_blocks ;
1912    unsigned long st_atime ;   1912    unsigned long st_atime ;
1913    unsigned long st_atime_nsec ;   1913    unsigned long st_atime_nsec ;
1914    unsigned long st_mtime ;   1914    unsigned long st_mtime ;
1915    unsigned long st_mtime_nsec ;   1915    unsigned long st_mtime_nsec ;
1916    unsigned long st_ctime ;   1916    unsigned long st_ctime ;
1917    unsigned long st_ctime_nsec ;   1917    unsigned long st_ctime_nsec ;
1918    unsigned long __unused4 ;   1918    unsigned long __unused4 ;
1919    unsigned long __unused5 ;   1919    unsigned long __unused5 ;
1920 };   1920 };
1921 struct vki_stat64 {   1921 struct vki_stat64 {
1922    unsigned long long st_dev ;   1922    unsigned long long st_dev ;
1923    unsigned char __pad0[4] ;   1923    unsigned char __pad0[4] ;
1924    unsigned long __st_ino ;   1924    unsigned long __st_ino ;
1925    unsigned int st_mode ;   1925    unsigned int st_mode ;
1926    unsigned int st_nlink ;   1926    unsigned int st_nlink ;
1927    unsigned long st_uid ;   1927    unsigned long st_uid ;
1928    unsigned long st_gid ;   1928    unsigned long st_gid ;
1929    unsigned long long st_rdev ;   1929    unsigned long long st_rdev ;
1930    unsigned char __pad3[4] ;   1930    unsigned char __pad3[4] ;
1931    long long st_size ;   1931    long long st_size ;
1932    unsigned long st_blksize ;   1932    unsigned long st_blksize ;
1933    unsigned long st_blocks ;   1933    unsigned long st_blocks ;
1934    unsigned long __pad4 ;   1934    unsigned long __pad4 ;
1935    unsigned long st_atime ;   1935    unsigned long st_atime ;
1936    unsigned long st_atime_nsec ;   1936    unsigned long st_atime_nsec ;
1937    unsigned long st_mtime ;   1937    unsigned long st_mtime ;
1938    unsigned int st_mtime_nsec ;   1938    unsigned int st_mtime_nsec ;
1939    unsigned long st_ctime ;   1939    unsigned long st_ctime ;
1940    unsigned long st_ctime_nsec ;   1940    unsigned long st_ctime_nsec ;
1941    unsigned long long st_ino ;   1941    unsigned long long st_ino ;
1942 };   1942 };
1943 struct vki_statfs {   1943 struct vki_statfs {
1944    __vki_u32 f_type ;   1944    __vki_u32 f_type ;
1945    __vki_u32 f_bsize ;   1945    __vki_u32 f_bsize ;
1946    __vki_u32 f_blocks ;   1946    __vki_u32 f_blocks ;
1947    __vki_u32 f_bfree ;   1947    __vki_u32 f_bfree ;
1948    __vki_u32 f_bavail ;   1948    __vki_u32 f_bavail ;
1949    __vki_u32 f_files ;   1949    __vki_u32 f_files ;
1950    __vki_u32 f_ffree ;   1950    __vki_u32 f_ffree ;
1951    __vki_kernel_fsid_t f_fsid ;   1951    __vki_kernel_fsid_t f_fsid ;
1952    __vki_u32 f_namelen ;   1952    __vki_u32 f_namelen ;
1953    __vki_u32 f_frsize ;   1953    __vki_u32 f_frsize ;
1954    __vki_u32 f_spare[5] ;   1954    __vki_u32 f_spare[5] ;
1955 };   1955 };
1956 struct vki_winsize {   1956 struct vki_winsize {
1957    unsigned short ws_row ;   1957    unsigned short ws_row ;
1958    unsigned short ws_col ;   1958    unsigned short ws_col ;
1959    unsigned short ws_xpixel ;   1959    unsigned short ws_xpixel ;
1960    unsigned short ws_ypixel ;   1960    unsigned short ws_ypixel ;
1961 };   1961 };
1962 struct vki_termio {   1962 struct vki_termio {
1963    unsigned short c_iflag ;   1963    unsigned short c_iflag ;
1964    unsigned short c_oflag ;   1964    unsigned short c_oflag ;
1965    unsigned short c_cflag ;   1965    unsigned short c_cflag ;
1966    unsigned short c_lflag ;   1966    unsigned short c_lflag ;
1967    unsigned char c_line ;   1967    unsigned char c_line ;
1968    unsigned char c_cc[8] ;   1968    unsigned char c_cc[8] ;
1969 };   1969 };
1970 typedef unsigned char vki_cc_t;   1970 typedef unsigned char vki_cc_t;
1971 typedef unsigned int vki_tcflag_t;   1971 typedef unsigned int vki_tcflag_t;
1972 struct vki_termios {   1972 struct vki_termios {
1973    vki_tcflag_t c_iflag ;   1973    vki_tcflag_t c_iflag ;
1974    vki_tcflag_t c_oflag ;   1974    vki_tcflag_t c_oflag ;
1975    vki_tcflag_t c_cflag ;   1975    vki_tcflag_t c_cflag ;
1976    vki_tcflag_t c_lflag ;   1976    vki_tcflag_t c_lflag ;
1977    vki_cc_t c_line ;   1977    vki_cc_t c_line ;
1978    vki_cc_t c_cc[19] ;   1978    vki_cc_t c_cc[19] ;
1979 };   1979 };
1980 struct vki_pollfd {   1980 struct vki_pollfd {
1981    int fd ;   1981    int fd ;
1982    short events ;   1982    short events ;
1983    short revents ;   1983    short revents ;
1984 };   1984 };
1985 struct vki_user_i387_struct {   1985 struct vki_user_i387_struct {
1986    long cwd ;   1986    long cwd ;
1987    long swd ;   1987    long swd ;
1988    long twd ;   1988    long twd ;
1989    long fip ;   1989    long fip ;
1990    long fcs ;   1990    long fcs ;
1991    long foo ;   1991    long foo ;
1992    long fos ;   1992    long fos ;
1993    long st_space[20] ;   1993    long st_space[20] ;
1994 };   1994 };
1995 struct vki_user_fxsr_struct {   1995 struct vki_user_fxsr_struct {
1996    unsigned short cwd ;   1996    unsigned short cwd ;
1997    unsigned short swd ;   1997    unsigned short swd ;
1998    unsigned short twd ;   1998    unsigned short twd ;
1999    unsigned short fop ;   1999    unsigned short fop ;
2000    long fip ;   2000    long fip ;
2001    long fcs ;   2001    long fcs ;
2002    long foo ;   2002    long foo ;
2003    long fos ;   2003    long fos ;
2004    long mxcsr ;   2004    long mxcsr ;
2005    long reserved ;   2005    long reserved ;
2006    long st_space[32] ;   2006    long st_space[32] ;
2007    long xmm_space[32] ;   2007    long xmm_space[32] ;
2008    long padding[56] ;   2008    long padding[56] ;
2009 };   2009 };
2010 struct vki_user_regs_struct {   2010 struct vki_user_regs_struct {
2011    long ebx ;   2011    long ebx ;
2012    long ecx ;   2012    long ecx ;
2013    long edx ;   2013    long edx ;
2014    long esi ;   2014    long esi ;
2015    long edi ;   2015    long edi ;
2016    long ebp ;   2016    long ebp ;
2017    long eax ;   2017    long eax ;
2018    unsigned short ds ;   2018    unsigned short ds ;
2019    unsigned short __ds ;   2019    unsigned short __ds ;
2020    unsigned short es ;   2020    unsigned short es ;
2021    unsigned short __es ;   2021    unsigned short __es ;
2022    unsigned short fs ;   2022    unsigned short fs ;
2023    unsigned short __fs ;   2023    unsigned short __fs ;
2024    unsigned short gs ;   2024    unsigned short gs ;
2025    unsigned short __gs ;   2025    unsigned short __gs ;
2026    long orig_eax ;   2026    long orig_eax ;
2027    long eip ;   2027    long eip ;
2028    unsigned short cs ;   2028    unsigned short cs ;
2029    unsigned short __cs ;   2029    unsigned short __cs ;
2030    long eflags ;   2030    long eflags ;
2031    long esp ;   2031    long esp ;
2032    unsigned short ss ;   2032    unsigned short ss ;
2033    unsigned short __ss ;   2033    unsigned short __ss ;
2034 };   2034 };
2035 typedef unsigned long vki_elf_greg_t;   2035 typedef unsigned long vki_elf_greg_t;
2036 typedef vki_elf_greg_t vki_elf_gregset_t[sizeof(struct vki_user_regs_struct ) / sizeof(vki_elf_greg_t )];   2036 typedef vki_elf_greg_t vki_elf_gregset_t[sizeof(struct vki_user_regs_struct ) / sizeof(vki_elf_greg_t )];
2037 typedef struct vki_user_i387_struct vki_elf_fpregset_t;   2037 typedef struct vki_user_i387_struct vki_elf_fpregset_t;
2038 typedef struct vki_user_fxsr_struct vki_elf_fpxregset_t;   2038 typedef struct vki_user_fxsr_struct vki_elf_fpxregset_t;
2039 struct vki_ucontext {   2039 struct vki_ucontext {
2040    unsigned long uc_flags ;   2040    unsigned long uc_flags ;
2041    struct vki_ucontext *uc_link ;   2041    struct vki_ucontext *uc_link ;
2042    vki_stack_t uc_stack ;   2042    vki_stack_t uc_stack ;
2043    struct vki_sigcontext uc_mcontext ;   2043    struct vki_sigcontext uc_mcontext ;
2044    vki_sigset_t uc_sigmask ;   2044    vki_sigset_t uc_sigmask ;
2045 };   2045 };
2046 struct vki_user_desc {   2046 struct vki_user_desc {
2047    unsigned int entry_number ;   2047    unsigned int entry_number ;
2048    unsigned long base_addr ;   2048    unsigned long base_addr ;
2049    unsigned int limit ;   2049    unsigned int limit ;
2050    unsigned int seg_32bit : 1 ;   2050    unsigned int seg_32bit : 1 ;
2051    unsigned int contents : 2 ;   2051    unsigned int contents : 2 ;
2052    unsigned int read_exec_only : 1 ;   2052    unsigned int read_exec_only : 1 ;
2053    unsigned int limit_in_pages : 1 ;   2053    unsigned int limit_in_pages : 1 ;
2054    unsigned int seg_not_present : 1 ;   2054    unsigned int seg_not_present : 1 ;
2055    unsigned int useable : 1 ;   2055    unsigned int useable : 1 ;
2056    unsigned int reserved : 25 ;   2056    unsigned int reserved : 25 ;
2057 };   2057 };
2058 typedef struct vki_user_desc vki_modify_ldt_t;   2058 typedef struct vki_user_desc vki_modify_ldt_t;
2059 struct vki_ipc64_perm {   2059 struct vki_ipc64_perm {
2060    __vki_kernel_key_t key ;   2060    __vki_kernel_key_t key ;
2061    __vki_kernel_uid32_t uid ;   2061    __vki_kernel_uid32_t uid ;
2062    __vki_kernel_gid32_t gid ;   2062    __vki_kernel_gid32_t gid ;
2063    __vki_kernel_uid32_t cuid ;   2063    __vki_kernel_uid32_t cuid ;
2064    __vki_kernel_gid32_t cgid ;   2064    __vki_kernel_gid32_t cgid ;
2065    __vki_kernel_mode_t mode ;   2065    __vki_kernel_mode_t mode ;
2066    unsigned short __pad1 ;   2066    unsigned short __pad1 ;
2067    unsigned short seq ;   2067    unsigned short seq ;
2068    unsigned short __pad2 ;   2068    unsigned short __pad2 ;
2069    unsigned long __unused1 ;   2069    unsigned long __unused1 ;
2070    unsigned long __unused2 ;   2070    unsigned long __unused2 ;
2071 };   2071 };
2072 struct vki_semid64_ds {   2072 struct vki_semid64_ds {
2073    struct vki_ipc64_perm sem_perm ;   2073    struct vki_ipc64_perm sem_perm ;
2074    __vki_kernel_time_t sem_otime ;   2074    __vki_kernel_time_t sem_otime ;
2075    unsigned long __unused1 ;   2075    unsigned long __unused1 ;
2076    __vki_kernel_time_t sem_ctime ;   2076    __vki_kernel_time_t sem_ctime ;
2077    unsigned long __unused2 ;   2077    unsigned long __unused2 ;
2078    unsigned long sem_nsems ;   2078    unsigned long sem_nsems ;
2079    unsigned long __unused3 ;   2079    unsigned long __unused3 ;
2080    unsigned long __unused4 ;   2080    unsigned long __unused4 ;
2081 };   2081 };
2082 struct vki_msqid64_ds {   2082 struct vki_msqid64_ds {
2083    struct vki_ipc64_perm msg_perm ;   2083    struct vki_ipc64_perm msg_perm ;
2084    __vki_kernel_time_t msg_stime ;   2084    __vki_kernel_time_t msg_stime ;
2085    unsigned long __unused1 ;   2085    unsigned long __unused1 ;
2086    __vki_kernel_time_t msg_rtime ;   2086    __vki_kernel_time_t msg_rtime ;
2087    unsigned long __unused2 ;   2087    unsigned long __unused2 ;
2088    __vki_kernel_time_t msg_ctime ;   2088    __vki_kernel_time_t msg_ctime ;
2089    unsigned long __unused3 ;   2089    unsigned long __unused3 ;
2090    unsigned long msg_cbytes ;   2090    unsigned long msg_cbytes ;
2091    unsigned long msg_qnum ;   2091    unsigned long msg_qnum ;
2092    unsigned long msg_qbytes ;   2092    unsigned long msg_qbytes ;
2093    __vki_kernel_pid_t msg_lspid ;   2093    __vki_kernel_pid_t msg_lspid ;
2094    __vki_kernel_pid_t msg_lrpid ;   2094    __vki_kernel_pid_t msg_lrpid ;
2095    unsigned long __unused4 ;   2095    unsigned long __unused4 ;
2096    unsigned long __unused5 ;   2096    unsigned long __unused5 ;
2097 };   2097 };
2098 struct vki_msgbuf;   2098 struct vki_msgbuf;
2099 struct vki_ipc_kludge {   2099 struct vki_ipc_kludge {
2100    struct vki_msgbuf *msgp ;   2100    struct vki_msgbuf *msgp ;
2101    long msgtyp ;   2101    long msgtyp ;
2102 };   2102 };
2103 struct vki_shmid64_ds {   2103 struct vki_shmid64_ds {
2104    struct vki_ipc64_perm shm_perm ;   2104    struct vki_ipc64_perm shm_perm ;
2105    vki_size_t shm_segsz ;   2105    vki_size_t shm_segsz ;
2106    __vki_kernel_time_t shm_atime ;   2106    __vki_kernel_time_t shm_atime ;
2107    unsigned long __unused1 ;   2107    unsigned long __unused1 ;
2108    __vki_kernel_time_t shm_dtime ;   2108    __vki_kernel_time_t shm_dtime ;
2109    unsigned long __unused2 ;   2109    unsigned long __unused2 ;
2110    __vki_kernel_time_t shm_ctime ;   2110    __vki_kernel_time_t shm_ctime ;
2111    unsigned long __unused3 ;   2111    unsigned long __unused3 ;
2112    __vki_kernel_pid_t shm_cpid ;   2112    __vki_kernel_pid_t shm_cpid ;
2113    __vki_kernel_pid_t shm_lpid ;   2113    __vki_kernel_pid_t shm_lpid ;
2114    unsigned long shm_nattch ;   2114    unsigned long shm_nattch ;
2115    unsigned long __unused4 ;   2115    unsigned long __unused4 ;
2116    unsigned long __unused5 ;   2116    unsigned long __unused5 ;
2117 };   2117 };
2118 struct vki_shminfo64 {   2118 struct vki_shminfo64 {
2119    unsigned long shmmax ;   2119    unsigned long shmmax ;
2120    unsigned long shmmin ;   2120    unsigned long shmmin ;
2121    unsigned long shmmni ;   2121    unsigned long shmmni ;
2122    unsigned long shmseg ;   2122    unsigned long shmseg ;
2123    unsigned long shmall ;   2123    unsigned long shmall ;
2124    unsigned long __unused1 ;   2124    unsigned long __unused1 ;
2125    unsigned long __unused2 ;   2125    unsigned long __unused2 ;
2126    unsigned long __unused3 ;   2126    unsigned long __unused3 ;
2127    unsigned long __unused4 ;   2127    unsigned long __unused4 ;
2128 };   2128 };
2129 struct vki_vm86_regs {   2129 struct vki_vm86_regs {
2130    long ebx ;   2130    long ebx ;
2131    long ecx ;   2131    long ecx ;
2132    long edx ;   2132    long edx ;
2133    long esi ;   2133    long esi ;
2134    long edi ;   2134    long edi ;
2135    long ebp ;   2135    long ebp ;
2136    long eax ;   2136    long eax ;
2137    long __null_ds ;   2137    long __null_ds ;
2138    long __null_es ;   2138    long __null_es ;
2139    long __null_fs ;   2139    long __null_fs ;
2140    long __null_gs ;   2140    long __null_gs ;
2141    long orig_eax ;   2141    long orig_eax ;
2142    long eip ;   2142    long eip ;
2143    unsigned short cs ;   2143    unsigned short cs ;
2144    unsigned short __csh ;   2144    unsigned short __csh ;
2145    long eflags ;   2145    long eflags ;
2146    long esp ;   2146    long esp ;
2147    unsigned short ss ;   2147    unsigned short ss ;
2148    unsigned short __ssh ;   2148    unsigned short __ssh ;
2149    unsigned short es ;   2149    unsigned short es ;
2150    unsigned short __esh ;   2150    unsigned short __esh ;
2151    unsigned short ds ;   2151    unsigned short ds ;
2152    unsigned short __dsh ;   2152    unsigned short __dsh ;
2153    unsigned short fs ;   2153    unsigned short fs ;
2154    unsigned short __fsh ;   2154    unsigned short __fsh ;
2155    unsigned short gs ;   2155    unsigned short gs ;
2156    unsigned short __gsh ;   2156    unsigned short __gsh ;
2157 };   2157 };
2158 struct vki_revectored_struct {   2158 struct vki_revectored_struct {
2159    unsigned long __map[8] ;   2159    unsigned long __map[8] ;
2160 };   2160 };
2161 struct vki_vm86_struct {   2161 struct vki_vm86_struct {
2162    struct vki_vm86_regs regs ;   2162    struct vki_vm86_regs regs ;
2163    unsigned long flags ;   2163    unsigned long flags ;
2164    unsigned long screen_bitmap ;   2164    unsigned long screen_bitmap ;
2165    unsigned long cpu_type ;   2165    unsigned long cpu_type ;
2166    struct vki_revectored_struct int_revectored ;   2166    struct vki_revectored_struct int_revectored ;
2167    struct vki_revectored_struct int21_revectored ;   2167    struct vki_revectored_struct int21_revectored ;
2168 };   2168 };
2169 struct vki_vm86plus_info_struct {   2169 struct vki_vm86plus_info_struct {
2170    unsigned long force_return_for_pic : 1 ;   2170    unsigned long force_return_for_pic : 1 ;
2171    unsigned long vm86dbg_active : 1 ;   2171    unsigned long vm86dbg_active : 1 ;
2172    unsigned long vm86dbg_TFpendig : 1 ;   2172    unsigned long vm86dbg_TFpendig : 1 ;
2173    unsigned long unused : 28 ;   2173    unsigned long unused : 28 ;
2174    unsigned long is_vm86pus : 1 ;   2174    unsigned long is_vm86pus : 1 ;
2175    unsigned char vm86dbg_intxxtab[32] ;   2175    unsigned char vm86dbg_intxxtab[32] ;
2176 };   2176 };
2177 struct vki_vm86plus_struct {   2177 struct vki_vm86plus_struct {
2178    struct vki_vm86_regs regs ;   2178    struct vki_vm86_regs regs ;
2179    unsigned long flags ;   2179    unsigned long flags ;
2180    unsigned long screen_bitmap ;   2180    unsigned long screen_bitmap ;
2181    unsigned long cpu_type ;   2181    unsigned long cpu_type ;
2182    struct vki_revectored_struct int_revectored ;   2182    struct vki_revectored_struct int_revectored ;
2183    struct vki_revectored_struct int21_revectored ;   2183    struct vki_revectored_struct int21_revectored ;
2184    struct vki_vm86plus_info_struct vm86plus ;   2184    struct vki_vm86plus_info_struct vm86plus ;
2185 };   2185 };
2186 typedef __vki_s32 vki_int32_t;   2186 typedef __vki_s32 vki_int32_t;
2187 typedef __vki_s64 vki_int64_t;   2187 typedef __vki_s64 vki_int64_t;
2188 typedef __vki_u8 vki_uint8_t;   2188 typedef __vki_u8 vki_uint8_t;
2189 typedef __vki_u16 vki_uint16_t;   2189 typedef __vki_u16 vki_uint16_t;
2190 typedef __vki_u32 vki_uint32_t;   2190 typedef __vki_u32 vki_uint32_t;
2191 typedef __vki_u16 __vki_le16;   2191 typedef __vki_u16 __vki_le16;
2192 struct vki_sysinfo {   2192 struct vki_sysinfo {
2193    long uptime ;   2193    long uptime ;
2194    unsigned long loads[3] ;   2194    unsigned long loads[3] ;
2195    unsigned long totalram ;   2195    unsigned long totalram ;
2196    unsigned long freeram ;   2196    unsigned long freeram ;
2197    unsigned long sharedram ;   2197    unsigned long sharedram ;
2198    unsigned long bufferram ;   2198    unsigned long bufferram ;
2199    unsigned long totalswap ;   2199    unsigned long totalswap ;
2200    unsigned long freeswap ;   2200    unsigned long freeswap ;
2201    unsigned short procs ;   2201    unsigned short procs ;
2202    unsigned short pad ;   2202    unsigned short pad ;
2203    unsigned long totalhigh ;   2203    unsigned long totalhigh ;
2204    unsigned long freehigh ;   2204    unsigned long freehigh ;
2205    unsigned int mem_unit ;   2205    unsigned int mem_unit ;
2206    char _f[(20U - 2U * sizeof(long )) - sizeof(int )] ;   2206    char _f[(20U - 2U * sizeof(long )) - sizeof(int )] ;
2207 };   2207 };
2208 struct vki_timespec {   2208 struct vki_timespec {
2209    vki_time_t tv_sec ;   2209    vki_time_t tv_sec ;
2210    long tv_nsec ;   2210    long tv_nsec ;
2211 };   2211 };
2212 struct vki_timeval {   2212 struct vki_timeval {
2213    vki_time_t tv_sec ;   2213    vki_time_t tv_sec ;
2214    vki_suseconds_t tv_usec ;   2214    vki_suseconds_t tv_usec ;
2215 };   2215 };
2216 struct vki_timezone {   2216 struct vki_timezone {
2217    int tz_minuteswest ;   2217    int tz_minuteswest ;
2218    int tz_dsttime ;   2218    int tz_dsttime ;
2219 };   2219 };
2220 struct vki_itimerspec {   2220 struct vki_itimerspec {
2221    struct vki_timespec it_interval ;   2221    struct vki_timespec it_interval ;
2222    struct vki_timespec it_value ;   2222    struct vki_timespec it_value ;
2223 };   2223 };
2224 struct vki_itimerval {   2224 struct vki_itimerval {
2225    struct vki_timeval it_interval ;   2225    struct vki_timeval it_interval ;
2226    struct vki_timeval it_value ;   2226    struct vki_timeval it_value ;
2227 };   2227 };
2228 struct vki_timex {   2228 struct vki_timex {
2229    unsigned int modes ;   2229    unsigned int modes ;
2230    long offset ;   2230    long offset ;
2231    long freq ;   2231    long freq ;
2232    long maxerror ;   2232    long maxerror ;
2233    long esterror ;   2233    long esterror ;
2234    int status ;   2234    int status ;
2235    long constant ;   2235    long constant ;
2236    long precision ;   2236    long precision ;
2237    long tolerance ;   2237    long tolerance ;
2238    struct vki_timeval time ;   2238    struct vki_timeval time ;
2239    long tick ;   2239    long tick ;
2240    long ppsfreq ;   2240    long ppsfreq ;
2241    long jitter ;   2241    long jitter ;
2242    int shift ;   2242    int shift ;
2243    long stabil ;   2243    long stabil ;
2244    long jitcnt ;   2244    long jitcnt ;
2245    long calcnt ;   2245    long calcnt ;
2246    long errcnt ;   2246    long errcnt ;
2247    long stbcnt ;   2247    long stbcnt ;
2248    int  : 32 ;   2248    int  : 32 ;
2249    int  : 32 ;   2249    int  : 32 ;
2250    int  : 32 ;   2250    int  : 32 ;
2251    int  : 32 ;   2251    int  : 32 ;
2252    int  : 32 ;   2252    int  : 32 ;
2253    int  : 32 ;   2253    int  : 32 ;
2254    int  : 32 ;   2254    int  : 32 ;
2255    int  : 32 ;   2255    int  : 32 ;
2256    int  : 32 ;   2256    int  : 32 ;
2257    int  : 32 ;   2257    int  : 32 ;
2258    int  : 32 ;   2258    int  : 32 ;
2259    int  : 32 ;   2259    int  : 32 ;
2260 };   2260 };
2261 struct vki_tms {   2261 struct vki_tms {
2262    vki_clock_t tms_utime ;   2262    vki_clock_t tms_utime ;
2263    vki_clock_t tms_stime ;   2263    vki_clock_t tms_stime ;
2264    vki_clock_t tms_cutime ;   2264    vki_clock_t tms_cutime ;
2265    vki_clock_t tms_cstime ;   2265    vki_clock_t tms_cstime ;
2266 };   2266 };
2267 struct vki_utimbuf {   2267 struct vki_utimbuf {
2268    vki_time_t actime ;   2268    vki_time_t actime ;
2269    vki_time_t modtime ;   2269    vki_time_t modtime ;
2270 };   2270 };
2271 struct vki_sched_param {   2271 struct vki_sched_param {
2272    int sched_priority ;   2272    int sched_priority ;
2273 };   2273 };
2274 union vki_sigval {   2274 union vki_sigval {
2275    int sival_int ;   2275    int sival_int ;
2276    void *sival_ptr ;   2276    void *sival_ptr ;
2277 };   2277 };
2278 typedef union vki_sigval vki_sigval_t;   2278 typedef union vki_sigval vki_sigval_t;
2279 struct __anonstruct__kill_100 {   2279 struct __anonstruct__kill_100 {
2280    vki_pid_t _pid ;   2280    vki_pid_t _pid ;
2281    vki_uid_t _uid ;   2281    vki_uid_t _uid ;
2282 };   2282 };
2283 struct __anonstruct__timer_101 {   2283 struct __anonstruct__timer_101 {
2284    vki_timer_t _tid ;   2284    vki_timer_t _tid ;
2285    int _overrun ;   2285    int _overrun ;
2286    char _pad[sizeof(vki_uid_t ) - sizeof(int )] ;   2286    char _pad[sizeof(vki_uid_t ) - sizeof(int )] ;
2287    vki_sigval_t _sigval ;   2287    vki_sigval_t _sigval ;
2288    int _sys_private ;   2288    int _sys_private ;
2289 };   2289 };
2290 struct __anonstruct__rt_102 {   2290 struct __anonstruct__rt_102 {
2291    vki_pid_t _pid ;   2291    vki_pid_t _pid ;
2292    vki_uid_t _uid ;   2292    vki_uid_t _uid ;
2293    vki_sigval_t _sigval ;   2293    vki_sigval_t _sigval ;
2294 };   2294 };
2295 struct __anonstruct__sigchld_103 {   2295 struct __anonstruct__sigchld_103 {
2296    vki_pid_t _pid ;   2296    vki_pid_t _pid ;
2297    vki_uid_t _uid ;   2297    vki_uid_t _uid ;
2298    int _status ;   2298    int _status ;
2299    vki_clock_t _utime ;   2299    vki_clock_t _utime ;
2300    vki_clock_t _stime ;   2300    vki_clock_t _stime ;
2301 };   2301 };
2302 struct __anonstruct__sigfault_104 {   2302 struct __anonstruct__sigfault_104 {
2303    void *_addr ;   2303    void *_addr ;
2304 };   2304 };
2305 struct __anonstruct__sigpoll_105 {   2305 struct __anonstruct__sigpoll_105 {
2306    long _band ;   2306    long _band ;
2307    int _fd ;   2307    int _fd ;
2308 };   2308 };
2309 union __anonunion__sifields_99 {   2309 union __anonunion__sifields_99 {
2310    int _pad[(128U - 3U * sizeof(int )) / sizeof(int )] ;   2310    int _pad[(128U - 3U * sizeof(int )) / sizeof(int )] ;
2311    struct __anonstruct__kill_100 _kill ;   2311    struct __anonstruct__kill_100 _kill ;
2312    struct __anonstruct__timer_101 _timer ;   2312    struct __anonstruct__timer_101 _timer ;
2313    struct __anonstruct__rt_102 _rt ;   2313    struct __anonstruct__rt_102 _rt ;
2314    struct __anonstruct__sigchld_103 _sigchld ;   2314    struct __anonstruct__sigchld_103 _sigchld ;
2315    struct __anonstruct__sigfault_104 _sigfault ;   2315    struct __anonstruct__sigfault_104 _sigfault ;
2316    struct __anonstruct__sigpoll_105 _sigpoll ;   2316    struct __anonstruct__sigpoll_105 _sigpoll ;
2317 };   2317 };
2318 struct vki_siginfo {   2318 struct vki_siginfo {
2319    int si_signo ;   2319    int si_signo ;
2320    int si_errno ;   2320    int si_errno ;
2321    int si_code ;   2321    int si_code ;
2322    union __anonunion__sifields_99 _sifields ;   2322    union __anonunion__sifields_99 _sifields ;
2323 };   2323 };
2324 typedef struct vki_siginfo vki_siginfo_t;   2324 typedef struct vki_siginfo vki_siginfo_t;
2325 struct __anonstruct__sigev_thread_107 {   2325 struct __anonstruct__sigev_thread_107 {
2326    void (*_function)(vki_sigval_t  ) ;   2326    void (*_function)(vki_sigval_t  ) ;
2327    void *_attribute ;   2327    void *_attribute ;
2328 };   2328 };
2329 union __anonunion__sigev_un_106 {   2329 union __anonunion__sigev_un_106 {
2330    int _pad[(64U - (sizeof(int ) * 2U + sizeof(vki_sigval_t ))) / sizeof(int )] ;   2330    int _pad[(64U - (sizeof(int ) * 2U + sizeof(vki_sigval_t ))) / sizeof(int )] ;
2331    int _tid ;   2331    int _tid ;
2332    struct __anonstruct__sigev_thread_107 _sigev_thread ;   2332    struct __anonstruct__sigev_thread_107 _sigev_thread ;
2333 };   2333 };
2334 struct vki_sigevent {   2334 struct vki_sigevent {
2335    vki_sigval_t sigev_value ;   2335    vki_sigval_t sigev_value ;
2336    int sigev_signo ;   2336    int sigev_signo ;
2337    int sigev_notify ;   2337    int sigev_notify ;
2338    union __anonunion__sigev_un_106 _sigev_un ;   2338    union __anonunion__sigev_un_106 _sigev_un ;
2339 };   2339 };
2340 typedef struct vki_sigevent vki_sigevent_t;   2340 typedef struct vki_sigevent vki_sigevent_t;
2341 enum vki_sock_type {   2341 enum vki_sock_type {
2342     VKI_SOCK_STREAM = 1   2342     VKI_SOCK_STREAM = 1
2343 } ;   2343 } ;
2344 struct vki_iovec {   2344 struct vki_iovec {
2345    void *iov_base ;   2345    void *iov_base ;
2346    __vki_kernel_size_t iov_len ;   2346    __vki_kernel_size_t iov_len ;
2347 };   2347 };
2348 typedef unsigned short vki_sa_family_t;   2348 typedef unsigned short vki_sa_family_t;
2349 struct vki_sockaddr {   2349 struct vki_sockaddr {
2350    vki_sa_family_t sa_family ;   2350    vki_sa_family_t sa_family ;
2351    char sa_data[14] ;   2351    char sa_data[14] ;
2352 };   2352 };
2353 struct vki_msghdr {   2353 struct vki_msghdr {
2354    void *msg_name ;   2354    void *msg_name ;
2355    int msg_namelen ;   2355    int msg_namelen ;
2356    struct vki_iovec *msg_iov ;   2356    struct vki_iovec *msg_iov ;
2357    __vki_kernel_size_t msg_iovlen ;   2357    __vki_kernel_size_t msg_iovlen ;
2358    void *msg_control ;   2358    void *msg_control ;
2359    __vki_kernel_size_t msg_controllen ;   2359    __vki_kernel_size_t msg_controllen ;
2360    unsigned int msg_flags ;   2360    unsigned int msg_flags ;
2361 };   2361 };
2362 struct vki_mmsghdr {   2362 struct vki_mmsghdr {
2363    struct vki_msghdr msg_hdr ;   2363    struct vki_msghdr msg_hdr ;
2364    unsigned int msg_len ;   2364    unsigned int msg_len ;
2365 };   2365 };
2366 struct vki_cmsghdr {   2366 struct vki_cmsghdr {
2367    __vki_kernel_size_t cmsg_len ;   2367    __vki_kernel_size_t cmsg_len ;
2368    int cmsg_level ;   2368    int cmsg_level ;
2369    int cmsg_type ;   2369    int cmsg_type ;
2370 };   2370 };
2371 struct vki_in_addr {   2371 struct vki_in_addr {
2372    __vki_u32 s_addr ;   2372    __vki_u32 s_addr ;
2373 };   2373 };
2374 struct vki_sockaddr_in {   2374 struct vki_sockaddr_in {
2375    vki_sa_family_t sin_family ;   2375    vki_sa_family_t sin_family ;
2376    unsigned short sin_port ;   2376    unsigned short sin_port ;
2377    struct vki_in_addr sin_addr ;   2377    struct vki_in_addr sin_addr ;
2378    unsigned char __pad[((16U - sizeof(short )) - sizeof(unsigned short )) - sizeof(struct vki_in_addr )] ;   2378    unsigned char __pad[((16U - sizeof(short )) - sizeof(unsigned short )) - sizeof(struct vki_in_addr )] ;
2379 };   2379 };
2380 union __anonunion_vki_in6_u_108 {   2380 union __anonunion_vki_in6_u_108 {
2381    __vki_u8 u6_addr8[16] ;   2381    __vki_u8 u6_addr8[16] ;
2382    __vki_u16 u6_addr16[8] ;   2382    __vki_u16 u6_addr16[8] ;
2383    __vki_u32 u6_addr32[4] ;   2383    __vki_u32 u6_addr32[4] ;
2384 };   2384 };
2385 struct vki_in6_addr {   2385 struct vki_in6_addr {
2386    union __anonunion_vki_in6_u_108 vki_in6_u ;   2386    union __anonunion_vki_in6_u_108 vki_in6_u ;
2387 };   2387 };
2388 struct vki_sockaddr_in6 {   2388 struct vki_sockaddr_in6 {
2389    unsigned short sin6_family ;   2389    unsigned short sin6_family ;
2390    __vki_u16 sin6_port ;   2390    __vki_u16 sin6_port ;
2391    __vki_u32 sin6_flowinfo ;   2391    __vki_u32 sin6_flowinfo ;
2392    struct vki_in6_addr sin6_addr ;   2392    struct vki_in6_addr sin6_addr ;
2393    __vki_u32 sin6_scope_id ;   2393    __vki_u32 sin6_scope_id ;
2394 };   2394 };
2395 struct vki_sockaddr_un {   2395 struct vki_sockaddr_un {
2396    vki_sa_family_t sun_family ;   2396    vki_sa_family_t sun_family ;
2397    char sun_path[108] ;   2397    char sun_path[108] ;
2398 };   2398 };
2399 struct vki_ifmap {   2399 struct vki_ifmap {
2400    unsigned long mem_start ;   2400    unsigned long mem_start ;
2401    unsigned long mem_end ;   2401    unsigned long mem_end ;
2402    unsigned short base_addr ;   2402    unsigned short base_addr ;
2403    unsigned char irq ;   2403    unsigned char irq ;
2404    unsigned char dma ;   2404    unsigned char dma ;
2405    unsigned char port ;   2405    unsigned char port ;
2406 };   2406 };
2407 union __anonunion_ifs_ifsu_109 {   2407 union __anonunion_ifs_ifsu_109 {
2408    void *raw_hdlc ;   2408    void *raw_hdlc ;
2409    void *cisco ;   2409    void *cisco ;
2410    void *fr ;   2410    void *fr ;
2411    void *fr_pvc ;   2411    void *fr_pvc ;
2412    void *fr_pvc_info ;   2412    void *fr_pvc_info ;
2413    void *sync ;   2413    void *sync ;
2414    void *te1 ;   2414    void *te1 ;
2415 };   2415 };
2416 struct vki_if_settings {   2416 struct vki_if_settings {
2417    unsigned int type ;   2417    unsigned int type ;
2418    unsigned int size ;   2418    unsigned int size ;
2419    union __anonunion_ifs_ifsu_109 ifs_ifsu ;   2419    union __anonunion_ifs_ifsu_109 ifs_ifsu ;
2420 };   2420 };
2421 union __anonunion_ifr_ifrn_110 {   2421 union __anonunion_ifr_ifrn_110 {
2422    char ifrn_name[16] ;   2422    char ifrn_name[16] ;
2423 };   2423 };
2424 union __anonunion_ifr_ifru_111 {   2424 union __anonunion_ifr_ifru_111 {
2425    struct vki_sockaddr ifru_addr ;   2425    struct vki_sockaddr ifru_addr ;
2426    struct vki_sockaddr ifru_dstaddr ;   2426    struct vki_sockaddr ifru_dstaddr ;
2427    struct vki_sockaddr ifru_broadaddr ;   2427    struct vki_sockaddr ifru_broadaddr ;
2428    struct vki_sockaddr ifru_netmask ;   2428    struct vki_sockaddr ifru_netmask ;
2429    struct vki_sockaddr ifru_hwaddr ;   2429    struct vki_sockaddr ifru_hwaddr ;
2430    short ifru_flags ;   2430    short ifru_flags ;
2431    int ifru_ivalue ;   2431    int ifru_ivalue ;
2432    int ifru_mtu ;   2432    int ifru_mtu ;
2433    struct vki_ifmap ifru_map ;   2433    struct vki_ifmap ifru_map ;
2434    char ifru_slave[16] ;   2434    char ifru_slave[16] ;
2435    char ifru_newname[16] ;   2435    char ifru_newname[16] ;
2436    void *ifru_data ;   2436    void *ifru_data ;
2437    struct vki_if_settings ifru_settings ;   2437    struct vki_if_settings ifru_settings ;
2438 };   2438 };
2439 struct vki_ifreq {   2439 struct vki_ifreq {
2440    union __anonunion_ifr_ifrn_110 ifr_ifrn ;   2440    union __anonunion_ifr_ifrn_110 ifr_ifrn ;
2441    union __anonunion_ifr_ifru_111 ifr_ifru ;   2441    union __anonunion_ifr_ifru_111 ifr_ifru ;
2442 };   2442 };
2443 union __anonunion_ifc_ifcu_112 {   2443 union __anonunion_ifc_ifcu_112 {
2444    char *ifcu_buf ;   2444    char *ifcu_buf ;
2445    struct vki_ifreq *ifcu_req ;   2445    struct vki_ifreq *ifcu_req ;
2446 };   2446 };
2447 struct vki_ifconf {   2447 struct vki_ifconf {
2448    int ifc_len ;   2448    int ifc_len ;
2449    union __anonunion_ifc_ifcu_112 ifc_ifcu ;   2449    union __anonunion_ifc_ifcu_112 ifc_ifcu ;
2450 };   2450 };
2451 struct vki_arpreq {   2451 struct vki_arpreq {
2452    struct vki_sockaddr arp_pa ;   2452    struct vki_sockaddr arp_pa ;
2453    struct vki_sockaddr arp_ha ;   2453    struct vki_sockaddr arp_ha ;
2454    int arp_flags ;   2454    int arp_flags ;
2455    struct vki_sockaddr arp_netmask ;   2455    struct vki_sockaddr arp_netmask ;
2456    char arp_dev[16] ;   2456    char arp_dev[16] ;
2457 };   2457 };
2458 struct vki_rtentry {   2458 struct vki_rtentry {
2459    unsigned long rt_pad1 ;   2459    unsigned long rt_pad1 ;
2460    struct vki_sockaddr rt_dst ;   2460    struct vki_sockaddr rt_dst ;
2461    struct vki_sockaddr rt_gateway ;   2461    struct vki_sockaddr rt_gateway ;
2462    struct vki_sockaddr rt_genmask ;   2462    struct vki_sockaddr rt_genmask ;
2463    unsigned short rt_flags ;   2463    unsigned short rt_flags ;
2464    short rt_pad2 ;   2464    short rt_pad2 ;
2465    unsigned long rt_pad3 ;   2465    unsigned long rt_pad3 ;
2466    void *rt_pad4 ;   2466    void *rt_pad4 ;
2467    short rt_metric ;   2467    short rt_metric ;
2468    char *rt_dev ;   2468    char *rt_dev ;
2469    unsigned long rt_mtu ;   2469    unsigned long rt_mtu ;
2470    unsigned long rt_window ;   2470    unsigned long rt_window ;
2471    unsigned short rt_irtt ;   2471    unsigned short rt_irtt ;
2472 };   2472 };
2473 typedef __vki_s32 vki_sctp_assoc_t;   2473 typedef __vki_s32 vki_sctp_assoc_t;
2474 enum vki_sctp_optname {   2474 enum vki_sctp_optname {
2475     VKI_SCTP_RTOINFO = 0,   2475     VKI_SCTP_RTOINFO = 0,
2476     VKI_SCTP_ASSOCINFO = 1,   2476     VKI_SCTP_ASSOCINFO = 1,
2477     VKI_SCTP_INITMSG = 2,   2477     VKI_SCTP_INITMSG = 2,
2478     VKI_SCTP_NODELAY = 3,   2478     VKI_SCTP_NODELAY = 3,
2479     VKI_SCTP_AUTOCLOSE = 4,   2479     VKI_SCTP_AUTOCLOSE = 4,
2480     VKI_SCTP_SET_PEER_PRIMARY_ADDR = 5,   2480     VKI_SCTP_SET_PEER_PRIMARY_ADDR = 5,
2481     VKI_SCTP_PRIMARY_ADDR = 6,   2481     VKI_SCTP_PRIMARY_ADDR = 6,
2482     VKI_SCTP_ADAPTION_LAYER = 7,   2482     VKI_SCTP_ADAPTION_LAYER = 7,
2483     VKI_SCTP_DISABLE_FRAGMENTS = 8,   2483     VKI_SCTP_DISABLE_FRAGMENTS = 8,
2484     VKI_SCTP_PEER_ADDR_PARAMS = 9,   2484     VKI_SCTP_PEER_ADDR_PARAMS = 9,
2485     VKI_SCTP_DEFAULT_SEND_PARAM = 10,   2485     VKI_SCTP_DEFAULT_SEND_PARAM = 10,
2486     VKI_SCTP_EVENTS = 11,   2486     VKI_SCTP_EVENTS = 11,
2487     VKI_SCTP_I_WANT_MAPPED_V4_ADDR = 12,   2487     VKI_SCTP_I_WANT_MAPPED_V4_ADDR = 12,
2488     VKI_SCTP_MAXSEG = 13,   2488     VKI_SCTP_MAXSEG = 13,
2489     VKI_SCTP_STATUS = 14,   2489     VKI_SCTP_STATUS = 14,
2490     VKI_SCTP_GET_PEER_ADDR_INFO = 15,   2490     VKI_SCTP_GET_PEER_ADDR_INFO = 15,
2491     VKI_SCTP_SOCKOPT_BINDX_ADD = 100,   2491     VKI_SCTP_SOCKOPT_BINDX_ADD = 100,
2492     VKI_SCTP_SOCKOPT_BINDX_REM = 101,   2492     VKI_SCTP_SOCKOPT_BINDX_REM = 101,
2493     VKI_SCTP_SOCKOPT_PEELOFF = 102,   2493     VKI_SCTP_SOCKOPT_PEELOFF = 102,
2494     VKI_SCTP_GET_PEER_ADDRS_NUM = 103,   2494     VKI_SCTP_GET_PEER_ADDRS_NUM = 103,
2495     VKI_SCTP_GET_PEER_ADDRS = 104,   2495     VKI_SCTP_GET_PEER_ADDRS = 104,
2496     VKI_SCTP_GET_LOCAL_ADDRS_NUM = 105,   2496     VKI_SCTP_GET_LOCAL_ADDRS_NUM = 105,
2497     VKI_SCTP_GET_LOCAL_ADDRS = 106,   2497     VKI_SCTP_GET_LOCAL_ADDRS = 106,
2498     VKI_SCTP_SOCKOPT_CONNECTX = 107   2498     VKI_SCTP_SOCKOPT_CONNECTX = 107
2499 } ;   2499 } ;
2500 struct vki_sctp_getaddrs {   2500 struct vki_sctp_getaddrs {
2501    vki_sctp_assoc_t assoc_id ;   2501    vki_sctp_assoc_t assoc_id ;
2502    int addr_num ;   2502    int addr_num ;
2503    struct vki_sockaddr *addrs ;   2503    struct vki_sockaddr *addrs ;
2504 };   2504 };
2505 struct vki_rusage {   2505 struct vki_rusage {
2506    struct vki_timeval ru_utime ;   2506    struct vki_timeval ru_utime ;
2507    struct vki_timeval ru_stime ;   2507    struct vki_timeval ru_stime ;
2508    long ru_maxrss ;   2508    long ru_maxrss ;
2509    long ru_ixrss ;   2509    long ru_ixrss ;
2510    long ru_idrss ;   2510    long ru_idrss ;
2511    long ru_isrss ;   2511    long ru_isrss ;
2512    long ru_minflt ;   2512    long ru_minflt ;
2513    long ru_majflt ;   2513    long ru_majflt ;
2514    long ru_nswap ;   2514    long ru_nswap ;
2515    long ru_inblock ;   2515    long ru_inblock ;
2516    long ru_oublock ;   2516    long ru_oublock ;
2517    long ru_msgsnd ;   2517    long ru_msgsnd ;
2518    long ru_msgrcv ;   2518    long ru_msgrcv ;
2519    long ru_nsignals ;   2519    long ru_nsignals ;
2520    long ru_nvcsw ;   2520    long ru_nvcsw ;
2521    long ru_nivcsw ;   2521    long ru_nivcsw ;
2522 };   2522 };
2523 struct vki_rlimit {   2523 struct vki_rlimit {
2524    unsigned long rlim_cur ;   2524    unsigned long rlim_cur ;
2525    unsigned long rlim_max ;   2525    unsigned long rlim_max ;
2526 };   2526 };
2527 struct vki_rlimit64 {   2527 struct vki_rlimit64 {
2528    __vki_u64 rlim_cur ;   2528    __vki_u64 rlim_cur ;
2529    __vki_u64 rlim_max ;   2529    __vki_u64 rlim_max ;
2530 };   2530 };
2531 struct vki_elf_siginfo {   2531 struct vki_elf_siginfo {
2532    int si_signo ;   2532    int si_signo ;
2533    int si_code ;   2533    int si_code ;
2534    int si_errno ;   2534    int si_errno ;
2535 };   2535 };
2536 struct vki_elf_prstatus {   2536 struct vki_elf_prstatus {
2537    struct vki_elf_siginfo pr_info ;   2537    struct vki_elf_siginfo pr_info ;
2538    short pr_cursig ;   2538    short pr_cursig ;
2539    unsigned long pr_sigpend ;   2539    unsigned long pr_sigpend ;
2540    unsigned long pr_sighold ;   2540    unsigned long pr_sighold ;
2541    vki_pid_t pr_pid ;   2541    vki_pid_t pr_pid ;
2542    vki_pid_t pr_ppid ;   2542    vki_pid_t pr_ppid ;
2543    vki_pid_t pr_pgrp ;   2543    vki_pid_t pr_pgrp ;
2544    vki_pid_t pr_sid ;   2544    vki_pid_t pr_sid ;
2545    struct vki_timeval pr_utime ;   2545    struct vki_timeval pr_utime ;
2546    struct vki_timeval pr_stime ;   2546    struct vki_timeval pr_stime ;
2547    struct vki_timeval pr_cutime ;   2547    struct vki_timeval pr_cutime ;
2548    struct vki_timeval pr_cstime ;   2548    struct vki_timeval pr_cstime ;
2549    vki_elf_gregset_t pr_reg ;   2549    vki_elf_gregset_t pr_reg ;
2550    int pr_fpvalid ;   2550    int pr_fpvalid ;
2551 };   2551 };
2552 struct vki_elf_prpsinfo {   2552 struct vki_elf_prpsinfo {
2553    char pr_state ;   2553    char pr_state ;
2554    char pr_sname ;   2554    char pr_sname ;
2555    char pr_zomb ;   2555    char pr_zomb ;
2556    char pr_nice ;   2556    char pr_nice ;
2557    unsigned long pr_flag ;   2557    unsigned long pr_flag ;
2558    __vki_kernel_uid_t pr_uid ;   2558    __vki_kernel_uid_t pr_uid ;
2559    __vki_kernel_gid_t pr_gid ;   2559    __vki_kernel_gid_t pr_gid ;
2560    vki_pid_t pr_pid ;   2560    vki_pid_t pr_pid ;
2561    vki_pid_t pr_ppid ;   2561    vki_pid_t pr_ppid ;
2562    vki_pid_t pr_pgrp ;   2562    vki_pid_t pr_pgrp ;
2563    vki_pid_t pr_sid ;   2563    vki_pid_t pr_sid ;
2564    char pr_fname[16] ;   2564    char pr_fname[16] ;
2565    char pr_psargs[80] ;   2565    char pr_psargs[80] ;
2566 };   2566 };
2567 struct vki_epoll_event {   2567 struct vki_epoll_event {
2568    __vki_u32 events ;   2568    __vki_u32 events ;
2569    __vki_u64 data ;   2569    __vki_u64 data ;
2570 };   2570 };
2571 struct vki_mq_attr {   2571 struct vki_mq_attr {
2572    long mq_flags ;   2572    long mq_flags ;
2573    long mq_maxmsg ;   2573    long mq_maxmsg ;
2574    long mq_msgsize ;   2574    long mq_msgsize ;
2575    long mq_curmsgs ;   2575    long mq_curmsgs ;
2576    long __reserved[4] ;   2576    long __reserved[4] ;
2577 };   2577 };
2578 struct vki_new_utsname {   2578 struct vki_new_utsname {
2579    char sysname[65] ;   2579    char sysname[65] ;
2580    char nodename[65] ;   2580    char nodename[65] ;
2581    char release[65] ;   2581    char release[65] ;
2582    char version[65] ;   2582    char version[65] ;
2583    char machine[65] ;   2583    char machine[65] ;
2584    char domainname[65] ;   2584    char domainname[65] ;
2585 };   2585 };
2586 struct vki_mii_ioctl_data {   2586 struct vki_mii_ioctl_data {
2587    vki_u16 phy_id ;   2587    vki_u16 phy_id ;
2588    vki_u16 reg_num ;   2588    vki_u16 reg_num ;
2589    vki_u16 val_in ;   2589    vki_u16 val_in ;
2590    vki_u16 val_out ;   2590    vki_u16 val_out ;
2591 };   2591 };
2592 struct __vki_user_cap_header_struct {   2592 struct __vki_user_cap_header_struct {
2593    __vki_u32 version ;   2593    __vki_u32 version ;
2594    int pid ;   2594    int pid ;
2595 };   2595 };
2596 typedef struct __vki_user_cap_header_struct *vki_cap_user_header_t;   2596 typedef struct __vki_user_cap_header_struct *vki_cap_user_header_t;
2597 struct __vki_user_cap_data_struct {   2597 struct __vki_user_cap_data_struct {
2598    __vki_u32 effective ;   2598    __vki_u32 effective ;
2599    __vki_u32 permitted ;   2599    __vki_u32 permitted ;
2600    __vki_u32 inheritable ;   2600    __vki_u32 inheritable ;
2601 };   2601 };
2602 typedef struct __vki_user_cap_data_struct *vki_cap_user_data_t;   2602 typedef struct __vki_user_cap_data_struct *vki_cap_user_data_t;
2603 struct vki_ipc_perm {   2603 struct vki_ipc_perm {
2604    __vki_kernel_key_t key ;   2604    __vki_kernel_key_t key ;
2605    __vki_kernel_uid_t uid ;   2605    __vki_kernel_uid_t uid ;
2606    __vki_kernel_gid_t gid ;   2606    __vki_kernel_gid_t gid ;
2607    __vki_kernel_uid_t cuid ;   2607    __vki_kernel_uid_t cuid ;
2608    __vki_kernel_gid_t cgid ;   2608    __vki_kernel_gid_t cgid ;
2609    __vki_kernel_mode_t mode ;   2609    __vki_kernel_mode_t mode ;
2610    unsigned short seq ;   2610    unsigned short seq ;
2611 };   2611 };
2612 struct vki_semid_ds {   2612 struct vki_semid_ds {
2613    struct vki_ipc_perm sem_perm ;   2613    struct vki_ipc_perm sem_perm ;
2614    __vki_kernel_time_t sem_otime ;   2614    __vki_kernel_time_t sem_otime ;
2615    __vki_kernel_time_t sem_ctime ;   2615    __vki_kernel_time_t sem_ctime ;
2616    void *sem_base ;   2616    void *sem_base ;
2617    void *sem_pending ;   2617    void *sem_pending ;
2618    void **sem_pending_last ;   2618    void **sem_pending_last ;
2619    void *undo ;   2619    void *undo ;
2620    unsigned short sem_nsems ;   2620    unsigned short sem_nsems ;
2621 };   2621 };
2622 struct vki_sembuf {   2622 struct vki_sembuf {
2623    unsigned short sem_num ;   2623    unsigned short sem_num ;
2624    short sem_op ;   2624    short sem_op ;
2625    short sem_flg ;   2625    short sem_flg ;
2626 };   2626 };
2627 struct vki_seminfo;   2627 struct vki_seminfo;
2628 union vki_semun {   2628 union vki_semun {
2629    int val ;   2629    int val ;
2630    struct vki_semid_ds *buf ;   2630    struct vki_semid_ds *buf ;
2631    unsigned short *array ;   2631    unsigned short *array ;
2632    struct vki_seminfo *__buf ;   2632    struct vki_seminfo *__buf ;
2633    void *__pad ;   2633    void *__pad ;
2634 };   2634 };
2635 struct vki_seminfo {   2635 struct vki_seminfo {
2636    int semmap ;   2636    int semmap ;
2637    int semmni ;   2637    int semmni ;
2638    int semmns ;   2638    int semmns ;
2639    int semmnu ;   2639    int semmnu ;
2640    int semmsl ;   2640    int semmsl ;
2641    int semopm ;   2641    int semopm ;
2642    int semume ;   2642    int semume ;
2643    int semusz ;   2643    int semusz ;
2644    int semvmx ;   2644    int semvmx ;
2645    int semaem ;   2645    int semaem ;
2646 };   2646 };
2647 struct vki_robust_list {   2647 struct vki_robust_list {
2648    struct vki_robust_list *next ;   2648    struct vki_robust_list *next ;
2649 };   2649 };
2650 struct vki_robust_list_head {   2650 struct vki_robust_list_head {
2651    struct vki_robust_list list ;   2651    struct vki_robust_list list ;
2652    long futex_offset ;   2652    long futex_offset ;
2653    struct vki_robust_list *list_op_pending ;   2653    struct vki_robust_list *list_op_pending ;
2654 };   2654 };
2655 struct vki_dirent {   2655 struct vki_dirent {
2656    long d_ino ;   2656    long d_ino ;
2657    __vki_kernel_off_t d_off ;   2657    __vki_kernel_off_t d_off ;
2658    unsigned short d_reclen ;   2658    unsigned short d_reclen ;
2659    char d_name[256] ;   2659    char d_name[256] ;
2660 };   2660 };
2661 struct __vki_sysctl_args {   2661 struct __vki_sysctl_args {
2662    int *name ;   2662    int *name ;
2663    int nlen ;   2663    int nlen ;
2664    void *oldval ;   2664    void *oldval ;
2665    vki_size_t *oldlenp ;   2665    vki_size_t *oldlenp ;
2666    void *newval ;   2666    void *newval ;
2667    vki_size_t newlen ;   2667    vki_size_t newlen ;
2668    unsigned long __unused[4] ;   2668    unsigned long __unused[4] ;
2669 };   2669 };
2670 typedef unsigned long vki_aio_context_t;   2670 typedef unsigned long vki_aio_context_t;
2671 enum __anonenum_113 {   2671 enum __anonenum_113 {
2672     VKI_IOCB_CMD_PREAD = 0,   2672     VKI_IOCB_CMD_PREAD = 0,
2673     VKI_IOCB_CMD_PWRITE = 1,   2673     VKI_IOCB_CMD_PWRITE = 1,
2674     VKI_IOCB_CMD_FSYNC = 2,   2674     VKI_IOCB_CMD_FSYNC = 2,
2675     VKI_IOCB_CMD_FDSYNC = 3,   2675     VKI_IOCB_CMD_FDSYNC = 3,
2676     VKI_IOCB_CMD_PREADV = 7,   2676     VKI_IOCB_CMD_PREADV = 7,
2677     VKI_IOCB_CMD_PWRITEV = 8   2677     VKI_IOCB_CMD_PWRITEV = 8
2678 } ;   2678 } ;
2679 struct vki_io_event {   2679 struct vki_io_event {
2680    __vki_u64 data ;   2680    __vki_u64 data ;
2681    __vki_u64 obj ;   2681    __vki_u64 obj ;
2682    __vki_s64 result ;   2682    __vki_s64 result ;
2683    __vki_s64 result2 ;   2683    __vki_s64 result2 ;
2684 };   2684 };
2685 struct vki_iocb {   2685 struct vki_iocb {
2686    __vki_u64 aio_data ;   2686    __vki_u64 aio_data ;
2687    __vki_u32 aio_key ;   2687    __vki_u32 aio_key ;
2688    __vki_u32 aio_reserved1 ;   2688    __vki_u32 aio_reserved1 ;
2689    __vki_u16 aio_lio_opcode ;   2689    __vki_u16 aio_lio_opcode ;
2690    __vki_s16 aio_reqprio ;   2690    __vki_s16 aio_reqprio ;
2691    __vki_u32 aio_fildes ;   2691    __vki_u32 aio_fildes ;
2692    __vki_u64 aio_buf ;   2692    __vki_u64 aio_buf ;
2693    __vki_u64 aio_nbytes ;   2693    __vki_u64 aio_nbytes ;
2694    __vki_s64 aio_offset ;   2694    __vki_s64 aio_offset ;
2695    __vki_u64 aio_reserved2 ;   2695    __vki_u64 aio_reserved2 ;
2696    __vki_u64 aio_reserved3 ;   2696    __vki_u64 aio_reserved3 ;
2697 };   2697 };
2698 struct vki_aio_ring {   2698 struct vki_aio_ring {
2699    unsigned int id ;   2699    unsigned int id ;
2700    unsigned int nr ;   2700    unsigned int nr ;
2701    unsigned int head ;   2701    unsigned int head ;
2702    unsigned int tail ;   2702    unsigned int tail ;
2703    unsigned int magic ;   2703    unsigned int magic ;
2704    unsigned int compat_features ;   2704    unsigned int compat_features ;
2705    unsigned int incompat_features ;   2705    unsigned int incompat_features ;
2706    unsigned int header_length ;   2706    unsigned int header_length ;
2707    struct vki_io_event io_events[0] ;   2707    struct vki_io_event io_events[0] ;
2708 };   2708 };
2709 struct vki_msg;   2709 struct vki_msg;
2710 struct vki_msqid_ds {   2710 struct vki_msqid_ds {
2711    struct vki_ipc_perm msg_perm ;   2711    struct vki_ipc_perm msg_perm ;
2712    struct vki_msg *msg_first ;   2712    struct vki_msg *msg_first ;
2713    struct vki_msg *msg_last ;   2713    struct vki_msg *msg_last ;
2714    __vki_kernel_time_t msg_stime ;   2714    __vki_kernel_time_t msg_stime ;
2715    __vki_kernel_time_t msg_rtime ;   2715    __vki_kernel_time_t msg_rtime ;
2716    __vki_kernel_time_t msg_ctime ;   2716    __vki_kernel_time_t msg_ctime ;
2717    unsigned long msg_lcbytes ;   2717    unsigned long msg_lcbytes ;
2718    unsigned long msg_lqbytes ;   2718    unsigned long msg_lqbytes ;
2719    unsigned short msg_cbytes ;   2719    unsigned short msg_cbytes ;
2720    unsigned short msg_qnum ;   2720    unsigned short msg_qnum ;
2721    unsigned short msg_qbytes ;   2721    unsigned short msg_qbytes ;
2722    __vki_kernel_ipc_pid_t msg_lspid ;   2722    __vki_kernel_ipc_pid_t msg_lspid ;
2723    __vki_kernel_ipc_pid_t msg_lrpid ;   2723    __vki_kernel_ipc_pid_t msg_lrpid ;
2724 };   2724 };
2725 struct vki_msgbuf {   2725 struct vki_msgbuf {
2726    long mtype ;   2726    long mtype ;
2727    char mtext[1] ;   2727    char mtext[1] ;
2728 };   2728 };
2729 struct vki_msginfo {   2729 struct vki_msginfo {
2730    int msgpool ;   2730    int msgpool ;
2731    int msgmap ;   2731    int msgmap ;
2732    int msgmax ;   2732    int msgmax ;
2733    int msgmnb ;   2733    int msgmnb ;
2734    int msgmni ;   2734    int msgmni ;
2735    int msgssz ;   2735    int msgssz ;
2736    int msgtql ;   2736    int msgtql ;
2737    unsigned short msgseg ;   2737    unsigned short msgseg ;
2738 };   2738 };
2739 struct vki_shmid_ds {   2739 struct vki_shmid_ds {
2740    struct vki_ipc_perm shm_perm ;   2740    struct vki_ipc_perm shm_perm ;
2741    int shm_segsz ;   2741    int shm_segsz ;
2742    __vki_kernel_time_t shm_atime ;   2742    __vki_kernel_time_t shm_atime ;
2743    __vki_kernel_time_t shm_dtime ;   2743    __vki_kernel_time_t shm_dtime ;
2744    __vki_kernel_time_t shm_ctime ;   2744    __vki_kernel_time_t shm_ctime ;
2745    __vki_kernel_ipc_pid_t shm_cpid ;   2745    __vki_kernel_ipc_pid_t shm_cpid ;
2746    __vki_kernel_ipc_pid_t shm_lpid ;   2746    __vki_kernel_ipc_pid_t shm_lpid ;
2747    unsigned short shm_nattch ;   2747    unsigned short shm_nattch ;
2748    unsigned short shm_unused ;   2748    unsigned short shm_unused ;
2749    void *shm_unused2 ;   2749    void *shm_unused2 ;
2750    void *shm_unused3 ;   2750    void *shm_unused3 ;
2751 };   2751 };
2752 struct vki_shminfo {   2752 struct vki_shminfo {
2753    int shmmax ;   2753    int shmmax ;
2754    int shmmin ;   2754    int shmmin ;
2755    int shmmni ;   2755    int shmmni ;
2756    int shmseg ;   2756    int shmseg ;
2757    int shmall ;   2757    int shmall ;
2758 };   2758 };
2759 struct vki_shm_info {   2759 struct vki_shm_info {
2760    int used_ids ;   2760    int used_ids ;
2761    unsigned long shm_tot ;   2761    unsigned long shm_tot ;
2762    unsigned long shm_rss ;   2762    unsigned long shm_rss ;
2763    unsigned long shm_swp ;   2763    unsigned long shm_swp ;
2764    unsigned long swap_attempts ;   2764    unsigned long swap_attempts ;
2765    unsigned long swap_successes ;   2765    unsigned long swap_successes ;
2766 };   2766 };
2767 struct vki_rtc_time {   2767 struct vki_rtc_time {
2768    int tm_sec ;   2768    int tm_sec ;
2769    int tm_min ;   2769    int tm_min ;
2770    int tm_hour ;   2770    int tm_hour ;
2771    int tm_mday ;   2771    int tm_mday ;
2772    int tm_mon ;   2772    int tm_mon ;
2773    int tm_year ;   2773    int tm_year ;
2774    int tm_wday ;   2774    int tm_wday ;
2775    int tm_yday ;   2775    int tm_yday ;
2776    int tm_isdst ;   2776    int tm_isdst ;
2777 };   2777 };
2778 struct __anonstruct_vki_isdn_net_ioctl_phone_114 {   2778 struct __anonstruct_vki_isdn_net_ioctl_phone_114 {
2779    char name[10] ;   2779    char name[10] ;
2780    char phone[32] ;   2780    char phone[32] ;
2781    int outgoing ;   2781    int outgoing ;
2782 };   2782 };
2783 typedef struct __anonstruct_vki_isdn_net_ioctl_phone_114 vki_isdn_net_ioctl_phone;   2783 typedef struct __anonstruct_vki_isdn_net_ioctl_phone_114 vki_isdn_net_ioctl_phone;
2784 struct vki_ppdev_frob_struct {   2784 struct vki_ppdev_frob_struct {
2785    unsigned char mask ;   2785    unsigned char mask ;
2786    unsigned char val ;   2786    unsigned char val ;
2787 };   2787 };
2788 struct vki_sg_io_hdr {   2788 struct vki_sg_io_hdr {
2789    int interface_id ;   2789    int interface_id ;
2790    int dxfer_direction ;   2790    int dxfer_direction ;
2791    unsigned char cmd_len ;   2791    unsigned char cmd_len ;
2792    unsigned char mx_sb_len ;   2792    unsigned char mx_sb_len ;
2793    unsigned short iovec_count ;   2793    unsigned short iovec_count ;
2794    unsigned int dxfer_len ;   2794    unsigned int dxfer_len ;
2795    void *dxferp ;   2795    void *dxferp ;
2796    unsigned char *cmdp ;   2796    unsigned char *cmdp ;
2797    void *sbp ;   2797    void *sbp ;
2798    unsigned int timeout ;   2798    unsigned int timeout ;
2799    unsigned int flags ;   2799    unsigned int flags ;
2800    int pack_id ;   2800    int pack_id ;
2801    void *usr_ptr ;   2801    void *usr_ptr ;
2802    unsigned char status ;   2802    unsigned char status ;
2803    unsigned char masked_status ;   2803    unsigned char masked_status ;
2804    unsigned char msg_status ;   2804    unsigned char msg_status ;
2805    unsigned char sb_len_wr ;   2805    unsigned char sb_len_wr ;
2806    unsigned short host_status ;   2806    unsigned short host_status ;
2807    unsigned short driver_status ;   2807    unsigned short driver_status ;
2808    int resid ;   2808    int resid ;
2809    unsigned int duration ;   2809    unsigned int duration ;
2810    unsigned int info ;   2810    unsigned int info ;
2811 };   2811 };
2812 typedef struct vki_sg_io_hdr vki_sg_io_hdr_t;   2812 typedef struct vki_sg_io_hdr vki_sg_io_hdr_t;
2813 struct vki_sg_scsi_id {   2813 struct vki_sg_scsi_id {
2814    int host_no ;   2814    int host_no ;
2815    int channel ;   2815    int channel ;
2816    int scsi_id ;   2816    int scsi_id ;
2817    int lun ;   2817    int lun ;
2818    int scsi_type ;   2818    int scsi_type ;
2819    short h_cmd_per_lun ;   2819    short h_cmd_per_lun ;
2820    short d_queue_depth ;   2820    short d_queue_depth ;
2821    int unused[2] ;   2821    int unused[2] ;
2822 };   2822 };
2823 typedef struct vki_sg_scsi_id vki_sg_scsi_id_t;   2823 typedef struct vki_sg_scsi_id vki_sg_scsi_id_t;
2824 struct vki_scsi_idlun {   2824 struct vki_scsi_idlun {
2825    __vki_u32 dev_id ;   2825    __vki_u32 dev_id ;
2826    __vki_u32 host_unique_id ;   2826    __vki_u32 host_unique_id ;
2827 };   2827 };
2828 struct vki_cdrom_msf0 {   2828 struct vki_cdrom_msf0 {
2829    __vki_u8 minute ;   2829    __vki_u8 minute ;
2830    __vki_u8 second ;   2830    __vki_u8 second ;
2831    __vki_u8 frame ;   2831    __vki_u8 frame ;
2832 };   2832 };
2833 union vki_cdrom_addr {   2833 union vki_cdrom_addr {
2834    struct vki_cdrom_msf0 msf ;   2834    struct vki_cdrom_msf0 msf ;
2835    int lba ;   2835    int lba ;
2836 };   2836 };
2837 struct vki_cdrom_msf {   2837 struct vki_cdrom_msf {
2838    __vki_u8 cdmsf_min0 ;   2838    __vki_u8 cdmsf_min0 ;
2839    __vki_u8 cdmsf_sec0 ;   2839    __vki_u8 cdmsf_sec0 ;
2840    __vki_u8 cdmsf_frame0 ;   2840    __vki_u8 cdmsf_frame0 ;
2841    __vki_u8 cdmsf_min1 ;   2841    __vki_u8 cdmsf_min1 ;
2842    __vki_u8 cdmsf_sec1 ;   2842    __vki_u8 cdmsf_sec1 ;
2843    __vki_u8 cdmsf_frame1 ;   2843    __vki_u8 cdmsf_frame1 ;
2844 };   2844 };
2845 struct vki_cdrom_tochdr {   2845 struct vki_cdrom_tochdr {
2846    __vki_u8 cdth_trk0 ;   2846    __vki_u8 cdth_trk0 ;
2847    __vki_u8 cdth_trk1 ;   2847    __vki_u8 cdth_trk1 ;
2848 };   2848 };
2849 struct vki_cdrom_volctrl {   2849 struct vki_cdrom_volctrl {
2850    __vki_u8 channel0 ;   2850    __vki_u8 channel0 ;
2851    __vki_u8 channel1 ;   2851    __vki_u8 channel1 ;
2852    __vki_u8 channel2 ;   2852    __vki_u8 channel2 ;
2853    __vki_u8 channel3 ;   2853    __vki_u8 channel3 ;
2854 };   2854 };
2855 struct vki_cdrom_subchnl {   2855 struct vki_cdrom_subchnl {
2856    __vki_u8 cdsc_format ;   2856    __vki_u8 cdsc_format ;
2857    __vki_u8 cdsc_audiostatus ;   2857    __vki_u8 cdsc_audiostatus ;
2858    __vki_u8 cdsc_adr : 4 ;   2858    __vki_u8 cdsc_adr : 4 ;
2859    __vki_u8 cdsc_ctrl : 4 ;   2859    __vki_u8 cdsc_ctrl : 4 ;
2860    __vki_u8 cdsc_trk ;   2860    __vki_u8 cdsc_trk ;
2861    __vki_u8 cdsc_ind ;   2861    __vki_u8 cdsc_ind ;
2862    union vki_cdrom_addr cdsc_absaddr ;   2862    union vki_cdrom_addr cdsc_absaddr ;
2863    union vki_cdrom_addr cdsc_reladdr ;   2863    union vki_cdrom_addr cdsc_reladdr ;
2864 };   2864 };
2865 struct vki_cdrom_tocentry {   2865 struct vki_cdrom_tocentry {
2866    __vki_u8 cdte_track ;   2866    __vki_u8 cdte_track ;
2867    __vki_u8 cdte_adr : 4 ;   2867    __vki_u8 cdte_adr : 4 ;
2868    __vki_u8 cdte_ctrl : 4 ;   2868    __vki_u8 cdte_ctrl : 4 ;
2869    __vki_u8 cdte_format ;   2869    __vki_u8 cdte_format ;
2870    union vki_cdrom_addr cdte_addr ;   2870    union vki_cdrom_addr cdte_addr ;
2871    __vki_u8 cdte_datamode ;   2871    __vki_u8 cdte_datamode ;
2872 };   2872 };
2873 struct vki_cdrom_read {   2873 struct vki_cdrom_read {
2874    int cdread_lba ;   2874    int cdread_lba ;
2875    char *cdread_bufaddr ;   2875    char *cdread_bufaddr ;
2876    int cdread_buflen ;   2876    int cdread_buflen ;
2877 };   2877 };
2878 struct vki_cdrom_read_audio {   2878 struct vki_cdrom_read_audio {
2879    union vki_cdrom_addr addr ;   2879    union vki_cdrom_addr addr ;
2880    __vki_u8 addr_format ;   2880    __vki_u8 addr_format ;
2881    int nframes ;   2881    int nframes ;
2882    __vki_u8 *buf ;   2882    __vki_u8 *buf ;
2883 };   2883 };
2884 struct vki_cdrom_multisession {   2884 struct vki_cdrom_multisession {
2885    union vki_cdrom_addr addr ;   2885    union vki_cdrom_addr addr ;
2886    __vki_u8 xa_flag ;   2886    __vki_u8 xa_flag ;
2887    __vki_u8 addr_format ;   2887    __vki_u8 addr_format ;
2888 };   2888 };
2889 struct vki_cdrom_mcn {   2889 struct vki_cdrom_mcn {
2890    __vki_u8 medium_catalog_number[14] ;   2890    __vki_u8 medium_catalog_number[14] ;
2891 };   2891 };
2892 struct vki_cdrom_generic_command {   2892 struct vki_cdrom_generic_command {
2893    unsigned char cmd[12] ;   2893    unsigned char cmd[12] ;
2894    unsigned char *buffer ;   2894    unsigned char *buffer ;
2895    unsigned int buflen ;   2895    unsigned int buflen ;
2896    int stat ;   2896    int stat ;
2897    void *sense ;   2897    void *sense ;
2898    unsigned char data_direction ;   2898    unsigned char data_direction ;
2899    int quiet ;   2899    int quiet ;
2900    int timeout ;   2900    int timeout ;
2901    void *reserved[1] ;   2901    void *reserved[1] ;
2902 };   2902 };
2903 struct vki_audio_buf_info {   2903 struct vki_audio_buf_info {
2904    int fragments ;   2904    int fragments ;
2905    int fragstotal ;   2905    int fragstotal ;
2906    int fragsize ;   2906    int fragsize ;
2907    int bytes ;   2907    int bytes ;
2908 };   2908 };
2909 typedef struct vki_audio_buf_info vki_audio_buf_info;   2909 typedef struct vki_audio_buf_info vki_audio_buf_info;
2910 struct vki_hd_geometry {   2910 struct vki_hd_geometry {
2911    unsigned char heads ;   2911    unsigned char heads ;
2912    unsigned char sectors ;   2912    unsigned char sectors ;
2913    unsigned short cylinders ;   2913    unsigned short cylinders ;
2914    unsigned long start ;   2914    unsigned long start ;
2915 };   2915 };
2916 struct vki_fb_fix_screeninfo {   2916 struct vki_fb_fix_screeninfo {
2917    char id[16] ;   2917    char id[16] ;
2918    unsigned long smem_start ;   2918    unsigned long smem_start ;
2919    __vki_u32 smem_len ;   2919    __vki_u32 smem_len ;
2920    __vki_u32 type ;   2920    __vki_u32 type ;
2921    __vki_u32 type_aux ;   2921    __vki_u32 type_aux ;
2922    __vki_u32 visual ;   2922    __vki_u32 visual ;
2923    __vki_u16 xpanstep ;   2923    __vki_u16 xpanstep ;
2924    __vki_u16 ypanstep ;   2924    __vki_u16 ypanstep ;
2925    __vki_u16 ywrapstep ;   2925    __vki_u16 ywrapstep ;
2926    __vki_u32 line_length ;   2926    __vki_u32 line_length ;
2927    unsigned long mmio_start ;   2927    unsigned long mmio_start ;
2928    __vki_u32 mmio_len ;   2928    __vki_u32 mmio_len ;
2929    __vki_u32 accel ;   2929    __vki_u32 accel ;
2930    __vki_u16 reserved[3] ;   2930    __vki_u16 reserved[3] ;
2931 };   2931 };
2932 struct vki_fb_bitfield {   2932 struct vki_fb_bitfield {
2933    __vki_u32 offset ;   2933    __vki_u32 offset ;
2934    __vki_u32 length ;   2934    __vki_u32 length ;
2935    __vki_u32 msb_right ;   2935    __vki_u32 msb_right ;
2936 };   2936 };
2937 struct vki_fb_var_screeninfo {   2937 struct vki_fb_var_screeninfo {
2938    __vki_u32 xres ;   2938    __vki_u32 xres ;
2939    __vki_u32 yres ;   2939    __vki_u32 yres ;
2940    __vki_u32 xres_virtual ;   2940    __vki_u32 xres_virtual ;
2941    __vki_u32 yres_virtual ;   2941    __vki_u32 yres_virtual ;
2942    __vki_u32 xoffset ;   2942    __vki_u32 xoffset ;
2943    __vki_u32 yoffset ;   2943    __vki_u32 yoffset ;
2944    __vki_u32 bits_per_pixel ;   2944    __vki_u32 bits_per_pixel ;
2945    __vki_u32 grayscale ;   2945    __vki_u32 grayscale ;
2946    struct vki_fb_bitfield red ;   2946    struct vki_fb_bitfield red ;
2947    struct vki_fb_bitfield green ;   2947    struct vki_fb_bitfield green ;
2948    struct vki_fb_bitfield blue ;   2948    struct vki_fb_bitfield blue ;
2949    struct vki_fb_bitfield transp ;   2949    struct vki_fb_bitfield transp ;
2950    __vki_u32 nonstd ;   2950    __vki_u32 nonstd ;
2951    __vki_u32 activate ;   2951    __vki_u32 activate ;
2952    __vki_u32 height ;   2952    __vki_u32 height ;
2953    __vki_u32 width ;   2953    __vki_u32 width ;
2954    __vki_u32 accel_flags ;   2954    __vki_u32 accel_flags ;
2955    __vki_u32 pixclock ;   2955    __vki_u32 pixclock ;
2956    __vki_u32 left_margin ;   2956    __vki_u32 left_margin ;
2957    __vki_u32 right_margin ;   2957    __vki_u32 right_margin ;
2958    __vki_u32 upper_margin ;   2958    __vki_u32 upper_margin ;
2959    __vki_u32 lower_margin ;   2959    __vki_u32 lower_margin ;
2960    __vki_u32 hsync_len ;   2960    __vki_u32 hsync_len ;
2961    __vki_u32 vsync_len ;   2961    __vki_u32 vsync_len ;
2962    __vki_u32 sync ;   2962    __vki_u32 sync ;
2963    __vki_u32 vmode ;   2963    __vki_u32 vmode ;
2964    __vki_u32 rotate ;   2964    __vki_u32 rotate ;
2965    __vki_u32 reserved[5] ;   2965    __vki_u32 reserved[5] ;
2966 };   2966 };
2967 struct vki_consolefontdesc {   2967 struct vki_consolefontdesc {
2968    unsigned short charcount ;   2968    unsigned short charcount ;
2969    unsigned short charheight ;   2969    unsigned short charheight ;
2970    char *chardata ;   2970    char *chardata ;
2971 };   2971 };
2972 struct vki_unipair {   2972 struct vki_unipair {
2973    unsigned short unicode ;   2973    unsigned short unicode ;
2974    unsigned short fontpos ;   2974    unsigned short fontpos ;
2975 };   2975 };
2976 struct vki_unimapdesc {   2976 struct vki_unimapdesc {
2977    unsigned short entry_ct ;   2977    unsigned short entry_ct ;
2978    struct vki_unipair *entries ;   2978    struct vki_unipair *entries ;
2979 };   2979 };
2980 struct vki_unimapinit {   2980 struct vki_unimapinit {
2981    unsigned short advised_hashsize ;   2981    unsigned short advised_hashsize ;
2982    unsigned short advised_hashstep ;   2982    unsigned short advised_hashstep ;
2983    unsigned short advised_hashlevel ;   2983    unsigned short advised_hashlevel ;
2984 };   2984 };
2985 struct vki_kbentry {   2985 struct vki_kbentry {
2986    unsigned char kb_table ;   2986    unsigned char kb_table ;
2987    unsigned char kb_index ;   2987    unsigned char kb_index ;
2988    unsigned short kb_value ;   2988    unsigned short kb_value ;
2989 };   2989 };
2990 struct vki_kbsentry {   2990 struct vki_kbsentry {
2991    unsigned char kb_func ;   2991    unsigned char kb_func ;
2992    unsigned char kb_string[512] ;   2992    unsigned char kb_string[512] ;
2993 };   2993 };
2994 struct vki_kbdiacr {   2994 struct vki_kbdiacr {
2995    unsigned char diacr ;   2995    unsigned char diacr ;
2996    unsigned char base ;   2996    unsigned char base ;
2997    unsigned char result ;   2997    unsigned char result ;
2998 };   2998 };
2999 struct vki_kbdiacrs {   2999 struct vki_kbdiacrs {
3000    unsigned int kb_cnt ;   3000    unsigned int kb_cnt ;
3001    struct vki_kbdiacr kbdiacr[256] ;   3001    struct vki_kbdiacr kbdiacr[256] ;
3002 };   3002 };
3003 struct vki_kbkeycode {   3003 struct vki_kbkeycode {
3004    unsigned int scancode ;   3004    unsigned int scancode ;
3005    unsigned int keycode ;   3005    unsigned int keycode ;
3006 };   3006 };
3007 struct vki_kbd_repeat {   3007 struct vki_kbd_repeat {
3008    int delay ;   3008    int delay ;
3009    int period ;   3009    int period ;
3010 };   3010 };
3011 struct vki_console_font_op {   3011 struct vki_console_font_op {
3012    unsigned int op ;   3012    unsigned int op ;
3013    unsigned int flags ;   3013    unsigned int flags ;
3014    unsigned int width ;   3014    unsigned int width ;
3015    unsigned int height ;   3015    unsigned int height ;
3016    unsigned int charcount ;   3016    unsigned int charcount ;
3017    unsigned char *data ;   3017    unsigned char *data ;
3018 };   3018 };
3019 typedef __vki_kernel_uid32_t vki_qid_t;   3019 typedef __vki_kernel_uid32_t vki_qid_t;
3020 struct __anonstruct_116 {   3020 struct __anonstruct_116 {
3021    int  : 0 ;   3021    int  : 0 ;
3022 };   3022 };
3023 struct __anonstruct_117 {   3023 struct __anonstruct_117 {
3024    int  : 0 ;   3024    int  : 0 ;
3025 };   3025 };
3026 enum __anonenum_115 {   3026 enum __anonenum_115 {
3027     VKI_SNDRV_PCM_IOCTL_HW_FREE = 16658,   3027     VKI_SNDRV_PCM_IOCTL_HW_FREE = 16658,
3028     VKI_SNDRV_PCM_IOCTL_HWSYNC = 16674,   3028     VKI_SNDRV_PCM_IOCTL_HWSYNC = 16674,
3029     VKI_SNDRV_PCM_IOCTL_PREPARE = 16704,   3029     VKI_SNDRV_PCM_IOCTL_PREPARE = 16704,
3030     VKI_SNDRV_PCM_IOCTL_RESET = 16705,   3030     VKI_SNDRV_PCM_IOCTL_RESET = 16705,
3031     VKI_SNDRV_PCM_IOCTL_START = 16706,   3031     VKI_SNDRV_PCM_IOCTL_START = 16706,
3032     VKI_SNDRV_PCM_IOCTL_DROP = 16707,   3032     VKI_SNDRV_PCM_IOCTL_DROP = 16707,
3033     VKI_SNDRV_PCM_IOCTL_DRAIN = 16708,   3033     VKI_SNDRV_PCM_IOCTL_DRAIN = 16708,
3034     VKI_SNDRV_PCM_IOCTL_PAUSE = 1074020677,   3034     VKI_SNDRV_PCM_IOCTL_PAUSE = 1074020677,
3035     VKI_SNDRV_PCM_IOCTL_RESUME = 16711,   3035     VKI_SNDRV_PCM_IOCTL_RESUME = 16711,
3036     VKI_SNDRV_PCM_IOCTL_XRUN = 16712,   3036     VKI_SNDRV_PCM_IOCTL_XRUN = 16712,
3037     VKI_SNDRV_PCM_IOCTL_LINK = 1074020704,   3037     VKI_SNDRV_PCM_IOCTL_LINK = 1074020704,
3038     VKI_SNDRV_PCM_IOCTL_UNLINK = 16737   3038     VKI_SNDRV_PCM_IOCTL_UNLINK = 16737
3039 } ;   3039 } ;
3040 enum __anonenum_118 {   3040 enum __anonenum_118 {
3041     VKI_SNDRV_TIMER_IOCTL_START = 21664,   3041     VKI_SNDRV_TIMER_IOCTL_START = 21664,
3042     VKI_SNDRV_TIMER_IOCTL_STOP = 21665,   3042     VKI_SNDRV_TIMER_IOCTL_STOP = 21665,
3043     VKI_SNDRV_TIMER_IOCTL_CONTINUE = 21666,   3043     VKI_SNDRV_TIMER_IOCTL_CONTINUE = 21666,
3044     VKI_SNDRV_TIMER_IOCTL_PAUSE = 21667   3044     VKI_SNDRV_TIMER_IOCTL_PAUSE = 21667
3045 } ;   3045 } ;
3046 struct vki_serial_icounter_struct {   3046 struct vki_serial_icounter_struct {
3047    int cts ;   3047    int cts ;
3048    int dsr ;   3048    int dsr ;
3049    int rng ;   3049    int rng ;
3050    int dcd ;   3050    int dcd ;
3051    int rx ;   3051    int rx ;
3052    int tx ;   3052    int tx ;
3053    int frame ;   3053    int frame ;
3054    int overrun ;   3054    int overrun ;
3055    int parity ;   3055    int parity ;
3056    int brk ;   3056    int brk ;
3057    int buf_overrun ;   3057    int buf_overrun ;
3058    int reserved[9] ;   3058    int reserved[9] ;
3059 };   3059 };
3060 struct vki_vt_mode {   3060 struct vki_vt_mode {
3061    char mode ;   3061    char mode ;
3062    char waitv ;   3062    char waitv ;
3063    short relsig ;   3063    short relsig ;
3064    short acqsig ;   3064    short acqsig ;
3065    short frsig ;   3065    short frsig ;
3066 };   3066 };
3067 struct vki_vt_stat {   3067 struct vki_vt_stat {
3068    unsigned short v_active ;   3068    unsigned short v_active ;
3069    unsigned short v_signal ;   3069    unsigned short v_signal ;
3070    unsigned short v_state ;   3070    unsigned short v_state ;
3071 };   3071 };
3072 struct vki_vt_sizes {   3072 struct vki_vt_sizes {
3073    unsigned short v_rows ;   3073    unsigned short v_rows ;
3074    unsigned short v_cols ;   3074    unsigned short v_cols ;
3075    unsigned short v_scrollsize ;   3075    unsigned short v_scrollsize ;
3076 };   3076 };
3077 struct vki_vt_consize {   3077 struct vki_vt_consize {
3078    unsigned short v_rows ;   3078    unsigned short v_rows ;
3079    unsigned short v_cols ;   3079    unsigned short v_cols ;
3080    unsigned short v_vlin ;   3080    unsigned short v_vlin ;
3081    unsigned short v_clin ;   3081    unsigned short v_clin ;
3082    unsigned short v_vcol ;   3082    unsigned short v_vcol ;
3083    unsigned short v_ccol ;   3083    unsigned short v_ccol ;
3084 };   3084 };
3085 struct vki_usbdevfs_ctrltransfer {   3085 struct vki_usbdevfs_ctrltransfer {
3086    __vki_u8 bRequestType ;   3086    __vki_u8 bRequestType ;
3087    __vki_u8 bRequest ;   3087    __vki_u8 bRequest ;
3088    __vki_u16 wValue ;   3088    __vki_u16 wValue ;
3089    __vki_u16 wIndex ;   3089    __vki_u16 wIndex ;
3090    __vki_u16 wLength ;   3090    __vki_u16 wLength ;
3091    __vki_u32 timeout ;   3091    __vki_u32 timeout ;
3092    void *data ;   3092    void *data ;
3093 };   3093 };
3094 struct vki_usbdevfs_bulktransfer {   3094 struct vki_usbdevfs_bulktransfer {
3095    unsigned int ep ;   3095    unsigned int ep ;
3096    unsigned int len ;   3096    unsigned int len ;
3097    unsigned int timeout ;   3097    unsigned int timeout ;
3098    void *data ;   3098    void *data ;
3099 };   3099 };
3100 struct vki_usbdevfs_getdriver {   3100 struct vki_usbdevfs_getdriver {
3101    unsigned int interface ;   3101    unsigned int interface ;
3102    char driver[256] ;   3102    char driver[256] ;
3103 };   3103 };
3104 struct vki_usbdevfs_connectinfo {   3104 struct vki_usbdevfs_connectinfo {
3105    unsigned int devnum ;   3105    unsigned int devnum ;
3106    unsigned char slow ;   3106    unsigned char slow ;
3107 };   3107 };
3108 struct vki_usbdevfs_iso_packet_desc {   3108 struct vki_usbdevfs_iso_packet_desc {
3109    unsigned int length ;   3109    unsigned int length ;
3110    unsigned int actual_length ;   3110    unsigned int actual_length ;
3111    unsigned int status ;   3111    unsigned int status ;
3112 };   3112 };
3113 struct vki_usbdevfs_urb {   3113 struct vki_usbdevfs_urb {
3114    unsigned char type ;   3114    unsigned char type ;
3115    unsigned char endpoint ;   3115    unsigned char endpoint ;
3116    int status ;   3116    int status ;
3117    unsigned int flags ;   3117    unsigned int flags ;
3118    void *buffer ;   3118    void *buffer ;
3119    int buffer_length ;   3119    int buffer_length ;
3120    int actual_length ;   3120    int actual_length ;
3121    int start_frame ;   3121    int start_frame ;
3122    int number_of_packets ;   3122    int number_of_packets ;
3123    int error_count ;   3123    int error_count ;
3124    unsigned int signr ;   3124    unsigned int signr ;
3125    void *usercontext ;   3125    void *usercontext ;
3126    struct vki_usbdevfs_iso_packet_desc iso_frame_desc[0] ;   3126    struct vki_usbdevfs_iso_packet_desc iso_frame_desc[0] ;
3127 };   3127 };
3128 struct vki_usbdevfs_ioctl {   3128 struct vki_usbdevfs_ioctl {
3129    int ifno ;   3129    int ifno ;
3130    int ioctl_code ;   3130    int ioctl_code ;
3131    void *data ;   3131    void *data ;
3132 };   3132 };
3133 struct vki_usbdevfs_setuppacket {   3133 struct vki_usbdevfs_setuppacket {
3134    __vki_u8 bRequestType ;   3134    __vki_u8 bRequestType ;
3135    __vki_u8 bRequest ;   3135    __vki_u8 bRequest ;
3136    __vki_u16 wValue ;   3136    __vki_u16 wValue ;
3137    __vki_u16 wIndex ;   3137    __vki_u16 wIndex ;
3138    __vki_u16 wLength ;   3138    __vki_u16 wLength ;
3139 };   3139 };
3140 struct vki_i2c_msg {   3140 struct vki_i2c_msg {
3141    __vki_u16 addr ;   3141    __vki_u16 addr ;
3142    __vki_u16 flags ;   3142    __vki_u16 flags ;
3143    __vki_u16 len ;   3143    __vki_u16 len ;
3144    __vki_u8 *buf ;   3144    __vki_u8 *buf ;
3145 };   3145 };
3146 struct vki_i2c_rdwr_ioctl_data {   3146 struct vki_i2c_rdwr_ioctl_data {
3147    struct vki_i2c_msg *msgs ;   3147    struct vki_i2c_msg *msgs ;
3148    __vki_u32 nmsgs ;   3148    __vki_u32 nmsgs ;
3149 };   3149 };
3150 typedef vki_int32_t vki_key_serial_t;   3150 typedef vki_int32_t vki_key_serial_t;
3151 typedef vki_uint32_t vki_key_perm_t;   3151 typedef vki_uint32_t vki_key_perm_t;
3152 struct vki_iw_param {   3152 struct vki_iw_param {
3153    __vki_s32 value ;   3153    __vki_s32 value ;
3154    __vki_u8 fixed ;   3154    __vki_u8 fixed ;
3155    __vki_u8 disabled ;   3155    __vki_u8 disabled ;
3156    __vki_u16 flags ;   3156    __vki_u16 flags ;
3157 };   3157 };
3158 struct vki_iw_point {   3158 struct vki_iw_point {
3159    void *pointer ;   3159    void *pointer ;
3160    __vki_u16 length ;   3160    __vki_u16 length ;
3161    __vki_u16 flags ;   3161    __vki_u16 flags ;
3162 };   3162 };
3163 struct vki_iw_freq {   3163 struct vki_iw_freq {
3164    __vki_s32 m ;   3164    __vki_s32 m ;
3165    __vki_s16 e ;   3165    __vki_s16 e ;
3166    __vki_u8 i ;   3166    __vki_u8 i ;
3167    __vki_u8 flags ;   3167    __vki_u8 flags ;
3168 };   3168 };
3169 struct vki_iw_quality {   3169 struct vki_iw_quality {
3170    __vki_u8 qual ;   3170    __vki_u8 qual ;
3171    __vki_u8 level ;   3171    __vki_u8 level ;
3172    __vki_u8 noise ;   3172    __vki_u8 noise ;
3173    __vki_u8 updated ;   3173    __vki_u8 updated ;
3174 };   3174 };
3175 union vki_iwreq_data {   3175 union vki_iwreq_data {
3176    char name[16] ;   3176    char name[16] ;
3177    struct vki_iw_point essid ;   3177    struct vki_iw_point essid ;
3178    struct vki_iw_param nwid ;   3178    struct vki_iw_param nwid ;
3179    struct vki_iw_freq freq ;   3179    struct vki_iw_freq freq ;
3180    struct vki_iw_param sens ;   3180    struct vki_iw_param sens ;
3181    struct vki_iw_param bitrate ;   3181    struct vki_iw_param bitrate ;
3182    struct vki_iw_param txpower ;   3182    struct vki_iw_param txpower ;
3183    struct vki_iw_param rts ;   3183    struct vki_iw_param rts ;
3184    struct vki_iw_param frag ;   3184    struct vki_iw_param frag ;
3185    __vki_u32 mode ;   3185    __vki_u32 mode ;
3186    struct vki_iw_param retry ;   3186    struct vki_iw_param retry ;
3187    struct vki_iw_point encoding ;   3187    struct vki_iw_point encoding ;
3188    struct vki_iw_param power ;   3188    struct vki_iw_param power ;
3189    struct vki_iw_quality qual ;   3189    struct vki_iw_quality qual ;
3190    struct vki_sockaddr ap_addr ;   3190    struct vki_sockaddr ap_addr ;
3191    struct vki_sockaddr addr ;   3191    struct vki_sockaddr addr ;
3192    struct vki_iw_param param ;   3192    struct vki_iw_param param ;
3193    struct vki_iw_point data ;   3193    struct vki_iw_point data ;
3194 };   3194 };
3195 union __anonunion_ifr_ifrn_119 {   3195 union __anonunion_ifr_ifrn_119 {
3196    char ifrn_name[16] ;   3196    char ifrn_name[16] ;
3197 };   3197 };
3198 struct vki_iwreq {   3198 struct vki_iwreq {
3199    union __anonunion_ifr_ifrn_119 ifr_ifrn ;   3199    union __anonunion_ifr_ifrn_119 ifr_ifrn ;
3200    union vki_iwreq_data u ;   3200    union vki_iwreq_data u ;
3201 };   3201 };
3202 union __anonunion____missing_field_name_120 {   3202 union __anonunion____missing_field_name_120 {
3203    __vki_u64 sample_period ;   3203    __vki_u64 sample_period ;
3204    __vki_u64 sample_freq ;   3204    __vki_u64 sample_freq ;
3205 };   3205 };
3206 union __anonunion____missing_field_name_121 {   3206 union __anonunion____missing_field_name_121 {
3207    __vki_u32 wakeup_events ;   3207    __vki_u32 wakeup_events ;
3208    __vki_u32 wakeup_watermark ;   3208    __vki_u32 wakeup_watermark ;
3209 };   3209 };
3210 union __anonunion____missing_field_name_122 {   3210 union __anonunion____missing_field_name_122 {
3211    __vki_u64 bp_addr ;   3211    __vki_u64 bp_addr ;
3212    __vki_u64 config1 ;   3212    __vki_u64 config1 ;
3213 };   3213 };
3214 union __anonunion____missing_field_name_123 {   3214 union __anonunion____missing_field_name_123 {
3215    __vki_u64 bp_len ;   3215    __vki_u64 bp_len ;
3216    __vki_u64 config2 ;   3216    __vki_u64 config2 ;
3217 };   3217 };
3218 struct vki_perf_event_attr {   3218 struct vki_perf_event_attr {
3219    __vki_u32 type ;   3219    __vki_u32 type ;
3220    __vki_u32 size ;   3220    __vki_u32 size ;
3221    __vki_u64 config ;   3221    __vki_u64 config ;
3222    union __anonunion____missing_field_name_120 __annonCompField1 ;   3222    union __anonunion____missing_field_name_120 __annonCompField1 ;
3223    __vki_u64 sample_type ;   3223    __vki_u64 sample_type ;
3224    __vki_u64 read_format ;   3224    __vki_u64 read_format ;
3225    __vki_u64 disabled : 1 ;   3225    __vki_u64 disabled : 1 ;
3226    __vki_u64 inherit : 1 ;   3226    __vki_u64 inherit : 1 ;
3227    __vki_u64 pinned : 1 ;   3227    __vki_u64 pinned : 1 ;
3228    __vki_u64 exclusive : 1 ;   3228    __vki_u64 exclusive : 1 ;
3229    __vki_u64 exclude_user : 1 ;   3229    __vki_u64 exclude_user : 1 ;
3230    __vki_u64 exclude_kernel : 1 ;   3230    __vki_u64 exclude_kernel : 1 ;
3231    __vki_u64 exclude_hv : 1 ;   3231    __vki_u64 exclude_hv : 1 ;
3232    __vki_u64 exclude_idle : 1 ;   3232    __vki_u64 exclude_idle : 1 ;
3233    __vki_u64 mmap : 1 ;   3233    __vki_u64 mmap : 1 ;
3234    __vki_u64 comm : 1 ;   3234    __vki_u64 comm : 1 ;
3235    __vki_u64 freq : 1 ;   3235    __vki_u64 freq : 1 ;
3236    __vki_u64 inherit_stat : 1 ;   3236    __vki_u64 inherit_stat : 1 ;
3237    __vki_u64 enable_on_exec : 1 ;   3237    __vki_u64 enable_on_exec : 1 ;
3238    __vki_u64 task : 1 ;   3238    __vki_u64 task : 1 ;
3239    __vki_u64 watermark : 1 ;   3239    __vki_u64 watermark : 1 ;
3240    __vki_u64 precise_ip : 2 ;   3240    __vki_u64 precise_ip : 2 ;
3241    __vki_u64 mmap_data : 1 ;   3241    __vki_u64 mmap_data : 1 ;
3242    __vki_u64 sample_id_all : 1 ;   3242    __vki_u64 sample_id_all : 1 ;
3243    __vki_u64 __reserved_1 : 45 ;   3243    __vki_u64 __reserved_1 : 45 ;
3244    union __anonunion____missing_field_name_121 __annonCompField2 ;   3244    union __anonunion____missing_field_name_121 __annonCompField2 ;
3245    __vki_u32 bp_type ;   3245    __vki_u32 bp_type ;
3246    union __anonunion____missing_field_name_122 __annonCompField3 ;   3246    union __anonunion____missing_field_name_122 __annonCompField3 ;
3247    union __anonunion____missing_field_name_123 __annonCompField4 ;   3247    union __anonunion____missing_field_name_123 __annonCompField4 ;
3248 };   3248 };
3249 struct vki_getcpu_cache {   3249 struct vki_getcpu_cache {
3250    unsigned long blob[128U / sizeof(long )] ;   3250    unsigned long blob[128U / sizeof(long )] ;
3251 };   3251 };
3252 struct __anonstruct_vki_bdaddr_t_124 {   3252 struct __anonstruct_vki_bdaddr_t_124 {
3253    __vki_u8 b[6] ;   3253    __vki_u8 b[6] ;
3254 } __attribute__((__packed__)) ;   3254 } __attribute__((__packed__)) ;
3255 typedef struct __anonstruct_vki_bdaddr_t_124 vki_bdaddr_t;   3255 typedef struct __anonstruct_vki_bdaddr_t_124 vki_bdaddr_t;
3256 struct vki_inquiry_info {   3256 struct vki_inquiry_info {
3257    vki_bdaddr_t bdaddr ;   3257    vki_bdaddr_t bdaddr ;
3258    __vki_u8 pscan_rep_mode ;   3258    __vki_u8 pscan_rep_mode ;
3259    __vki_u8 pscan_period_mode ;   3259    __vki_u8 pscan_period_mode ;
3260    __vki_u8 pscan_mode ;   3260    __vki_u8 pscan_mode ;
3261    __vki_u8 dev_class[3] ;   3261    __vki_u8 dev_class[3] ;
3262    __vki_le16 clock_offset ;   3262    __vki_le16 clock_offset ;
3263 } __attribute__((__packed__)) ;   3263 } __attribute__((__packed__)) ;
3264 struct vki_hci_inquiry_req {   3264 struct vki_hci_inquiry_req {
3265    __vki_u16 dev_id ;   3265    __vki_u16 dev_id ;
3266    __vki_u16 flags ;   3266    __vki_u16 flags ;
3267    __vki_u8 lap[3] ;   3267    __vki_u8 lap[3] ;
3268    __vki_u8 length ;   3268    __vki_u8 length ;
3269    __vki_u8 num_rsp ;   3269    __vki_u8 num_rsp ;
3270 };   3270 };
3271 typedef void (*vg_atfork_t)(ThreadId  );   3271 typedef void (*vg_atfork_t)(ThreadId  );
3272 __inline static Bool toBool(Int x )   3272 __inline static Bool toBool(Int x )
3273 {   3273 {
3274   Int r ;   3274   Int r ;
3275   int tmp ;   3275   int tmp ;
3276     3276  
3277   {   3277   {
3278   if (x == 0) {   3278   if (x == 0) {
3279     tmp = (int )((Bool )0);   3279     tmp = (int )((Bool )0);
3280   } else {   3280   } else {
3281     tmp = (int )((Bool )1);   3281     tmp = (int )((Bool )1);
3282   }   3282   }
3283   r = tmp;   3283   r = tmp;
3284   return ((Bool )r);   3284   return ((Bool )r);
3285 }   3285 }
3286 }   3286 }
3287 __inline static UChar toUChar(Int x )   3287 __inline static UChar toUChar(Int x )
3288 {   3288 {
3289     3289  
3290     3290  
3291   {   3291   {
3292   x &= 255;   3292   x &= 255;
3293   return ((UChar )x);   3293   return ((UChar )x);
3294 }   3294 }
3295 }   3295 }
3296 __inline static HChar toHChar(Int x )   3296 __inline static HChar toHChar(Int x )
3297 {   3297 {
3298     3298  
3299     3299  
3300   {   3300   {
3301   x &= 255;   3301   x &= 255;
3302   return ((HChar )x);   3302   return ((HChar )x);
3303 }   3303 }
3304 }   3304 }
3305 __inline static UShort toUShort(Int x )   3305 __inline static UShort toUShort(Int x )
3306 {   3306 {
3307     3307  
3308     3308  
3309   {   3309   {
3310   x &= 65535;   3310   x &= 65535;
3311   return ((UShort )x);   3311   return ((UShort )x);
3312 }   3312 }
3313 }   3313 }
3314 __inline static Short toShort(Int x )   3314 __inline static Short toShort(Int x )
3315 {   3315 {
3316     3316  
3317     3317  
3318   {   3318   {
3319   x &= 65535;   3319   x &= 65535;
3320   return ((Short )x);   3320   return ((Short )x);
3321 }   3321 }
3322 }   3322 }
3323 __inline static UInt toUInt(Long x )   3323 __inline static UInt toUInt(Long x )
3324 {   3324 {
3325     3325  
3326     3326  
3327   {   3327   {
3328   x &= 4294967295LL;   3328   x &= 4294967295LL;
3329   return ((UInt )x);   3329   return ((UInt )x);
3330 }   3330 }
3331 }   3331 }
3332 __inline static ULong Ptr_to_ULong(void *p )   3332 __inline static ULong Ptr_to_ULong(void *p )
3333 {   3333 {
3334   UInt w ;   3334   UInt w ;
3335     3335  
3336   {   3336   {
3337   w = (UInt )p;   3337   w = (UInt )p;
3338   return ((ULong )w);   3338   return ((ULong )w);
3339 }   3339 }
3340 }   3340 }
3341 __inline static void *ULong_to_Ptr(ULong n )   3341 __inline static void *ULong_to_Ptr(ULong n )
3342 {   3342 {
3343   UInt w ;   3343   UInt w ;
3344     3344  
3345   {   3345   {
3346   w = (UInt )n;   3346   w = (UInt )n;
3347   return ((void *)w);   3347   return ((void *)w);
3348 }   3348 }
3349 }   3349 }
3350 __inline static Bool sr_isError(SysRes sr )   3350 __inline static Bool sr_isError(SysRes sr )
3351 {   3351 {
3352     3352  
3353     3353  
3354   {   3354   {
3355   return (sr._isError);   3355   return (sr._isError);
3356 }   3356 }
3357 }   3357 }
3358 __inline static UWord sr_Res(SysRes sr )   3358 __inline static UWord sr_Res(SysRes sr )
3359 {   3359 {
3360   UWord tmp ;   3360   UWord tmp ;
3361     3361  
3362   {   3362   {
3363   if (sr._isError) {   3363   if (sr._isError) {
3364     tmp = (UWord )0;   3364     tmp = (UWord )0;
3365   } else {   3365   } else {
3366     tmp = sr._val;   3366     tmp = sr._val;
3367   }   3367   }
3368   return (tmp);   3368   return (tmp);
3369 }   3369 }
3370 }   3370 }
3371 __inline static UWord sr_ResHI(SysRes sr )   3371 __inline static UWord sr_ResHI(SysRes sr )
3372 {   3372 {
3373     3373  
3374     3374  
3375   {   3375   {
3376   return ((UWord )0);   3376   return ((UWord )0);
3377 }   3377 }
3378 }   3378 }
3379 __inline static UWord sr_Err(SysRes sr )   3379 __inline static UWord sr_Err(SysRes sr )
3380 {   3380 {
3381   UWord tmp ;   3381   UWord tmp ;
3382     3382  
3383   {   3383   {
3384   if (sr._isError) {   3384   if (sr._isError) {
3385     tmp = sr._val;   3385     tmp = sr._val;
3386   } else {   3386   } else {
3387     tmp = (UWord )0;   3387     tmp = (UWord )0;
3388   }   3388   }
3389   return (tmp);   3389   return (tmp);
3390 }   3390 }
3391 }   3391 }
3392 __inline static Bool sr_EQ(SysRes sr1 , SysRes sr2 )   3392 __inline static Bool sr_EQ(SysRes sr1 , SysRes sr2 )
3393 {   3393 {
3394   int tmp ;   3394   int tmp ;
3395     3395  
3396   {   3396   {
3397   if (sr1._val == sr2._val) {   3397   if (sr1._val == sr2._val) {
3398     if (sr1._isError) {   3398     if (sr1._isError) {
3399       if (sr2._isError) {   3399       if (sr2._isError) {
3400         tmp = 1;   3400         tmp = 1;
3401       } else {   3401       } else {
3402         goto _L;   3402         goto _L;
3403       }   3403       }
3404     } else   3404     } else
3405     _L: /* CIL Label */   3405     _L: /* CIL Label */
3406     if (! sr1._isError) {   3406     if (! sr1._isError) {
3407       if (! sr2._isError) {   3407       if (! sr2._isError) {
3408         tmp = 1;   3408         tmp = 1;
3409       } else {   3409       } else {
3410         tmp = 0;   3410         tmp = 0;
3411       }   3411       }
3412     } else {   3412     } else {
3413       tmp = 0;   3413       tmp = 0;
3414     }   3414     }
3415   } else {   3415   } else {
3416     tmp = 0;   3416     tmp = 0;
3417   }   3417   }
3418   return ((Bool )tmp);   3418   return ((Bool )tmp);
3419 }   3419 }
3420 }   3420 }
3421 extern OSet *vgPlain_OSetWord_Create(void *(*alloc)(HChar *cc , SizeT szB ) ,   3421 extern OSet *vgPlain_OSetWord_Create(void *(*alloc)(HChar *cc , SizeT szB ) ,
3422                                      HChar *cc , void (*_free)(void *p ) ) ;   3422                                      HChar *cc , void (*_free)(void *p ) ) ;
3423 extern void vgPlain_OSetWord_Destroy(OSet *os ) ;   3423 extern void vgPlain_OSetWord_Destroy(OSet *os ) ;
3424 extern Word vgPlain_OSetWord_Size(OSet *os ) ;   3424 extern Word vgPlain_OSetWord_Size(OSet *os ) ;
3425 extern void vgPlain_OSetWord_Insert(OSet *os , UWord val ) ;   3425 extern void vgPlain_OSetWord_Insert(OSet *os , UWord val ) ;
3426 extern Bool vgPlain_OSetWord_Contains(OSet *os , UWord val ) ;   3426 extern Bool vgPlain_OSetWord_Contains(OSet *os , UWord val ) ;
3427 extern Bool vgPlain_OSetWord_Remove(OSet *os , UWord val ) ;   3427 extern Bool vgPlain_OSetWord_Remove(OSet *os , UWord val ) ;
3428 extern void vgPlain_OSetWord_ResetIter(OSet *os ) ;   3428 extern void vgPlain_OSetWord_ResetIter(OSet *os ) ;
3429 extern Bool vgPlain_OSetWord_Next(OSet *os , UWord *val ) ;   3429 extern Bool vgPlain_OSetWord_Next(OSet *os , UWord *val ) ;
3430 extern OSet *vgPlain_OSetGen_Create(PtrdiffT keyOff ,   3430 extern OSet *vgPlain_OSetGen_Create(PtrdiffT keyOff ,
3431                                     Word (*cmp)(void const   *key ,   3431                                     Word (*cmp)(void const   *key ,
3432                                                 void const   *elem ) ,   3432                                                 void const   *elem ) ,
3433                                     void *(*alloc)(HChar *cc , SizeT szB ) ,   3433                                     void *(*alloc)(HChar *cc , SizeT szB ) ,
3434                                     HChar *cc , void (*_free)(void *p ) ) ;   3434                                     HChar *cc , void (*_free)(void *p ) ) ;
3435 extern OSet *vgPlain_OSetGen_Create_With_Pool(PtrdiffT keyOff ,   3435 extern OSet *vgPlain_OSetGen_Create_With_Pool(PtrdiffT keyOff ,
3436                                               Word (*cmp)(void const   *key ,   3436                                               Word (*cmp)(void const   *key ,
3437                                                           void const   *elem ) ,   3437                                                           void const   *elem ) ,
3438                                               void *(*alloc)(HChar *cc ,   3438                                               void *(*alloc)(HChar *cc ,
3439                                                              SizeT szB ) ,   3439                                                              SizeT szB ) ,
3440                                               HChar *cc ,   3440                                               HChar *cc ,
3441                                               void (*_free)(void *p ) ,   3441                                               void (*_free)(void *p ) ,
3442                                               SizeT poolSize , SizeT maxEltSize ) ;   3442                                               SizeT poolSize , SizeT maxEltSize ) ;
3443 extern void vgPlain_OSetGen_Destroy(OSet *os ) ;   3443 extern void vgPlain_OSetGen_Destroy(OSet *os ) ;
3444 extern void *vgPlain_OSetGen_AllocNode(OSet *os , SizeT elemSize ) ;   3444 extern void *vgPlain_OSetGen_AllocNode(OSet *os , SizeT elemSize ) ;
3445 extern void vgPlain_OSetGen_FreeNode(OSet *os , void *elem ) ;   3445 extern void vgPlain_OSetGen_FreeNode(OSet *os , void *elem ) ;
3446 extern OSet *vgPlain_OSetGen_EmptyClone(OSet *os ) ;   3446 extern OSet *vgPlain_OSetGen_EmptyClone(OSet *os ) ;
3447 extern Word vgPlain_OSetGen_Size(OSet const   *os ) ;   3447 extern Word vgPlain_OSetGen_Size(OSet const   *os ) ;
3448 extern void vgPlain_OSetGen_Insert(OSet *os , void *elem ) ;   3448 extern void vgPlain_OSetGen_Insert(OSet *os , void *elem ) ;
3449 extern Bool vgPlain_OSetGen_Contains(OSet const   *os , void const   *key ) ;   3449 extern Bool vgPlain_OSetGen_Contains(OSet const   *os , void const   *key ) ;
3450 extern void *vgPlain_OSetGen_Lookup(OSet const   *os , void const   *key ) ;   3450 extern void *vgPlain_OSetGen_Lookup(OSet const   *os , void const   *key ) ;
3451 extern void *vgPlain_OSetGen_LookupWithCmp(OSet *os , void const   *key ,   3451 extern void *vgPlain_OSetGen_LookupWithCmp(OSet *os , void const   *key ,
3452                                            Word (*cmp)(void const   *key ,   3452                                            Word (*cmp)(void const   *key ,
3453                                                        void const   *elem ) ) ;   3453                                                        void const   *elem ) ) ;
3454 extern void *vgPlain_OSetGen_Remove(OSet *os , void const   *key ) ;   3454 extern void *vgPlain_OSetGen_Remove(OSet *os , void const   *key ) ;
3455 extern void vgPlain_OSetGen_ResetIter(OSet *os ) ;   3455 extern void vgPlain_OSetGen_ResetIter(OSet *os ) ;
3456 extern void vgPlain_OSetGen_ResetIterAt(OSet *os , void const   *key ) ;   3456 extern void vgPlain_OSetGen_ResetIterAt(OSet *os , void const   *key ) ;
3457 extern void *vgPlain_OSetGen_Next(OSet *os ) ;   3457 extern void *vgPlain_OSetGen_Next(OSet *os ) ;
3458 void vgDrd_bm_module_init(void) ;   3458 void vgDrd_bm_module_init(void) ;
3459 void vgDrd_bm_module_cleanup(void) ;   3459 void vgDrd_bm_module_cleanup(void) ;
3460 struct bitmap *vgDrd_bm_new(void) ;   3460 struct bitmap *vgDrd_bm_new(void) ;
3461 void vgDrd_bm_delete(struct bitmap * const  bm ) ;   3461 void vgDrd_bm_delete(struct bitmap * const  bm ) ;
3462 void vgDrd_bm_init(struct bitmap * const  bm ) ;   3462 void vgDrd_bm_init(struct bitmap * const  bm ) ;
3463 void vgDrd_bm_cleanup(struct bitmap * const  bm ) ;   3463 void vgDrd_bm_cleanup(struct bitmap * const  bm ) ;
3464 void vgDrd_bm_access_range(struct bitmap * const  bm , Addr const   a1 ,   3464 void vgDrd_bm_access_range(struct bitmap * const  bm , Addr const   a1 ,
3465                            Addr const   a2 , BmAccessTypeT const   access_type ) ;   3465                            Addr const   a2 , BmAccessTypeT const   access_type ) ;
3466 void vgDrd_bm_access_range_load(struct bitmap * const  bm , Addr const   a1 ,   3466 void vgDrd_bm_access_range_load(struct bitmap * const  bm , Addr const   a1 ,
3467                                 Addr const   a2 ) ;   3467                                 Addr const   a2 ) ;
3468 void vgDrd_bm_access_load_1(struct bitmap * const  bm , Addr const   a1 ) ;   3468 void vgDrd_bm_access_load_1(struct bitmap * const  bm , Addr const   a1 ) ;
3469 void vgDrd_bm_access_load_2(struct bitmap * const  bm , Addr const   a1 ) ;   3469 void vgDrd_bm_access_load_2(struct bitmap * const  bm , Addr const   a1 ) ;
3470 void vgDrd_bm_access_load_4(struct bitmap * const  bm , Addr const   a1 ) ;   3470 void vgDrd_bm_access_load_4(struct bitmap * const  bm , Addr const   a1 ) ;
3471 void vgDrd_bm_access_load_8(struct bitmap * const  bm , Addr const   a1 ) ;   3471 void vgDrd_bm_access_load_8(struct bitmap * const  bm , Addr const   a1 ) ;
3472 void vgDrd_bm_access_range_store(struct bitmap * const  bm , Addr const   a1 ,   3472 void vgDrd_bm_access_range_store(struct bitmap * const  bm , Addr const   a1 ,
3473                                  Addr const   a2 ) ;   3473                                  Addr const   a2 ) ;
3474 void vgDrd_bm_access_store_1(struct bitmap * const  bm , Addr const   a1 ) ;   3474 void vgDrd_bm_access_store_1(struct bitmap * const  bm , Addr const   a1 ) ;
3475 void vgDrd_bm_access_store_2(struct bitmap * const  bm , Addr const   a1 ) ;   3475 void vgDrd_bm_access_store_2(struct bitmap * const  bm , Addr const   a1 ) ;
3476 void vgDrd_bm_access_store_4(struct bitmap * const  bm , Addr const   a1 ) ;   3476 void vgDrd_bm_access_store_4(struct bitmap * const  bm , Addr const   a1 ) ;
3477 void vgDrd_bm_access_store_8(struct bitmap * const  bm , Addr const   a1 ) ;   3477 void vgDrd_bm_access_store_8(struct bitmap * const  bm , Addr const   a1 ) ;
3478 Bool vgDrd_bm_has(struct bitmap * const  bm , Addr const   a1 ,   3478 Bool vgDrd_bm_has(struct bitmap * const  bm , Addr const   a1 ,
3479                   Addr const   a2 , BmAccessTypeT const   access_type ) ;   3479                   Addr const   a2 , BmAccessTypeT const   access_type ) ;
3480 Bool vgDrd_bm_has_any_load_g(struct bitmap * const  bm ) ;   3480 Bool vgDrd_bm_has_any_load_g(struct bitmap * const  bm ) ;
3481 Bool vgDrd_bm_has_any_load(struct bitmap * const  bm , Addr const   a1 ,   3481 Bool vgDrd_bm_has_any_load(struct bitmap * const  bm , Addr const   a1 ,
3482                            Addr const   a2 ) ;   3482                            Addr const   a2 ) ;
3483 Bool vgDrd_bm_has_any_store(struct bitmap * const  bm , Addr const   a1 ,   3483 Bool vgDrd_bm_has_any_store(struct bitmap * const  bm , Addr const   a1 ,
3484                             Addr const   a2 ) ;   3484                             Addr const   a2 ) ;
3485 Bool vgDrd_bm_has_any_access(struct bitmap * const  bm , Addr const   a1 ,   3485 Bool vgDrd_bm_has_any_access(struct bitmap * const  bm , Addr const   a1 ,
3486                              Addr const   a2 ) ;   3486                              Addr const   a2 ) ;
3487 Bool vgDrd_bm_has_1(struct bitmap * const  bm , Addr const   a ,   3487 Bool vgDrd_bm_has_1(struct bitmap * const  bm , Addr const   a ,
3488                     BmAccessTypeT const   access_type ) ;   3488                     BmAccessTypeT const   access_type ) ;
3489 void vgDrd_bm_clear(struct bitmap * const  bm , Addr const   a1 ,   3489 void vgDrd_bm_clear(struct bitmap * const  bm , Addr const   a1 ,
3490                     Addr const   a2 ) ;   3490                     Addr const   a2 ) ;
3491 void vgDrd_bm_clear_load(struct bitmap * const  bm , Addr const   a1 ,   3491 void vgDrd_bm_clear_load(struct bitmap * const  bm , Addr const   a1 ,
3492                          Addr const   a2 ) ;   3492                          Addr const   a2 ) ;
3493 void vgDrd_bm_clear_store(struct bitmap * const  bm , Addr const   a1 ,   3493 void vgDrd_bm_clear_store(struct bitmap * const  bm , Addr const   a1 ,
3494                           Addr const   a2 ) ;   3494                           Addr const   a2 ) ;
3495 Bool vgDrd_bm_test_and_clear(struct bitmap * const  bm , Addr const   a1 ,   3495 Bool vgDrd_bm_test_and_clear(struct bitmap * const  bm , Addr const   a1 ,
3496                              Addr const   a2 ) ;   3496                              Addr const   a2 ) ;
3497 Bool vgDrd_bm_has_conflict_with(struct bitmap * const  bm , Addr const   a1 ,   3497 Bool vgDrd_bm_has_conflict_with(struct bitmap * const  bm , Addr const   a1 ,
3498                                 Addr const   a2 ,   3498                                 Addr const   a2 ,
3499                                 BmAccessTypeT const   access_type ) ;   3499                                 BmAccessTypeT const   access_type ) ;
3500 Bool vgDrd_bm_load_1_has_conflict_with(struct bitmap * const  bm ,   3500 Bool vgDrd_bm_load_1_has_conflict_with(struct bitmap * const  bm ,
3501                                        Addr const   a1 ) ;   3501                                        Addr const   a1 ) ;
3502 Bool vgDrd_bm_load_2_has_conflict_with(struct bitmap * const  bm ,   3502 Bool vgDrd_bm_load_2_has_conflict_with(struct bitmap * const  bm ,
3503                                        Addr const   a1 ) ;   3503                                        Addr const   a1 ) ;
3504 Bool vgDrd_bm_load_4_has_conflict_with(struct bitmap * const  bm ,   3504 Bool vgDrd_bm_load_4_has_conflict_with(struct bitmap * const  bm ,
3505                                        Addr const   a1 ) ;   3505                                        Addr const   a1 ) ;
3506 Bool vgDrd_bm_load_8_has_conflict_with(struct bitmap * const  bm ,   3506 Bool vgDrd_bm_load_8_has_conflict_with(struct bitmap * const  bm ,
3507                                        Addr const   a1 ) ;   3507                                        Addr const   a1 ) ;
3508 Bool vgDrd_bm_load_has_conflict_with(struct bitmap * const  bm ,   3508 Bool vgDrd_bm_load_has_conflict_with(struct bitmap * const  bm ,
3509                                      Addr const   a1 , Addr const   a2 ) ;   3509                                      Addr const   a1 , Addr const   a2 ) ;
3510 Bool vgDrd_bm_store_1_has_conflict_with(struct bitmap * const  bm ,   3510 Bool vgDrd_bm_store_1_has_conflict_with(struct bitmap * const  bm ,
3511                                         Addr const   a1 ) ;   3511                                         Addr const   a1 ) ;
3512 Bool vgDrd_bm_store_2_has_conflict_with(struct bitmap * const  bm ,   3512 Bool vgDrd_bm_store_2_has_conflict_with(struct bitmap * const  bm ,
3513                                         Addr const   a1 ) ;   3513                                         Addr const   a1 ) ;
3514 Bool vgDrd_bm_store_4_has_conflict_with(struct bitmap * const  bm ,   3514 Bool vgDrd_bm_store_4_has_conflict_with(struct bitmap * const  bm ,
3515                                         Addr const   a1 ) ;   3515                                         Addr const   a1 ) ;
3516 Bool vgDrd_bm_store_8_has_conflict_with(struct bitmap * const  bm ,   3516 Bool vgDrd_bm_store_8_has_conflict_with(struct bitmap * const  bm ,
3517                                         Addr const   a1 ) ;   3517                                         Addr const   a1 ) ;
3518 Bool vgDrd_bm_store_has_conflict_with(struct bitmap * const  bm ,   3518 Bool vgDrd_bm_store_has_conflict_with(struct bitmap * const  bm ,
3519                                       Addr const   a1 , Addr const   a2 ) ;   3519                                       Addr const   a1 , Addr const   a2 ) ;
3520 Bool vgDrd_bm_equal(struct bitmap * const  lhs , struct bitmap * const  rhs ) ;   3520 Bool vgDrd_bm_equal(struct bitmap * const  lhs , struct bitmap * const  rhs ) ;
3521 void vgDrd_bm_swap(struct bitmap * const  bm1 , struct bitmap * const  bm2 ) ;   3521 void vgDrd_bm_swap(struct bitmap * const  bm1 , struct bitmap * const  bm2 ) ;
3522 void vgDrd_bm_merge2(struct bitmap * const  lhs , struct bitmap * const  rhs ) ;   3522 void vgDrd_bm_merge2(struct bitmap * const  lhs , struct bitmap * const  rhs ) ;
3523 void vgDrd_bm_unmark(struct bitmap *bm ) ;   3523 void vgDrd_bm_unmark(struct bitmap *bm ) ;
3524 Bool vgDrd_bm_is_marked(struct bitmap *bm , Addr const   a ) ;   3524 Bool vgDrd_bm_is_marked(struct bitmap *bm , Addr const   a ) ;
3525 void vgDrd_bm_mark(struct bitmap *bml , struct bitmap *bmr ) ;   3525 void vgDrd_bm_mark(struct bitmap *bml , struct bitmap *bmr ) ;
3526 void vgDrd_bm_clear_marked(struct bitmap *bm ) ;   3526 void vgDrd_bm_clear_marked(struct bitmap *bm ) ;
3527 void vgDrd_bm_merge2_marked(struct bitmap * const  lhs ,   3527 void vgDrd_bm_merge2_marked(struct bitmap * const  lhs ,
3528                             struct bitmap * const  rhs ) ;   3528                             struct bitmap * const  rhs ) ;
3529 void vgDrd_bm_remove_cleared_marked(struct bitmap *bm ) ;   3529 void vgDrd_bm_remove_cleared_marked(struct bitmap *bm ) ;
3530 int vgDrd_bm_has_races(struct bitmap * const  lhs , struct bitmap * const  rhs ) ;   3530 int vgDrd_bm_has_races(struct bitmap * const  lhs , struct bitmap * const  rhs ) ;
3531 extern void vgDrd_bm_report_races(ThreadId const   tid1 ,   3531 extern void vgDrd_bm_report_races(ThreadId const   tid1 ,
3532                                   ThreadId const   tid2 ,   3532                                   ThreadId const   tid2 ,
3533                                   struct bitmap * const  bm1 ,   3533                                   struct bitmap * const  bm1 ,
3534                                   struct bitmap * const  bm2 ) ;   3534                                   struct bitmap * const  bm2 ) ;
3535 void vgDrd_bm_print(struct bitmap * const  bm ) ;   3535 void vgDrd_bm_print(struct bitmap * const  bm ) ;
3536 ULong vgDrd_bm_get_bitmap_creation_count(void) ;   3536 ULong vgDrd_bm_get_bitmap_creation_count(void) ;
3537 ULong vgDrd_bm_get_bitmap2_creation_count(void) ;   3537 ULong vgDrd_bm_get_bitmap2_creation_count(void) ;
3538 ULong vgDrd_bm_get_bitmap2_merge_count(void) ;   3538 ULong vgDrd_bm_get_bitmap2_merge_count(void) ;
3539 extern Bool vgPlain_isspace(Char c ) ;   3539 extern Bool vgPlain_isspace(Char c ) ;
3540 extern Bool vgPlain_isdigit(Char c ) ;   3540 extern Bool vgPlain_isdigit(Char c ) ;
3541 extern Char vgPlain_tolower(Char c ) ;   3541 extern Char vgPlain_tolower(Char c ) ;
3542 extern Long vgPlain_strtoll10(Char *str , Char **endptr ) ;   3542 extern Long vgPlain_strtoll10(Char *str , Char **endptr ) ;
3543 extern Long vgPlain_strtoll16(Char *str , Char **endptr ) ;   3543 extern Long vgPlain_strtoll16(Char *str , Char **endptr ) ;
3544 extern ULong vgPlain_strtoull10(Char *str , Char **endptr ) ;   3544 extern ULong vgPlain_strtoull10(Char *str , Char **endptr ) ;
3545 extern ULong vgPlain_strtoull16(Char *str , Char **endptr ) ;   3545 extern ULong vgPlain_strtoull16(Char *str , Char **endptr ) ;
3546 extern double vgPlain_strtod(Char *str , Char **endptr ) ;   3546 extern double vgPlain_strtod(Char *str , Char **endptr ) ;
3547 extern SizeT vgPlain_strlen(Char const   *str ) ;   3547 extern SizeT vgPlain_strlen(Char const   *str ) ;
3548 extern Char *vgPlain_strcat(Char *dest , Char const   *src ) ;   3548 extern Char *vgPlain_strcat(Char *dest , Char const   *src ) ;
3549 extern Char *vgPlain_strncat(Char *dest , Char const   *src , SizeT n ) ;   3549 extern Char *vgPlain_strncat(Char *dest , Char const   *src , SizeT n ) ;
3550 extern Char *vgPlain_strpbrk(Char const   *s , Char const   *accpt ) ;   3550 extern Char *vgPlain_strpbrk(Char const   *s , Char const   *accpt ) ;
3551 extern Char *vgPlain_strcpy(Char *dest , Char const   *src ) ;   3551 extern Char *vgPlain_strcpy(Char *dest , Char const   *src ) ;
3552 extern Char *vgPlain_strncpy(Char *dest , Char const   *src , SizeT ndest ) ;   3552 extern Char *vgPlain_strncpy(Char *dest , Char const   *src , SizeT ndest ) ;
3553 extern Int vgPlain_strcmp(Char const   *s1 , Char const   *s2 ) ;   3553 extern Int vgPlain_strcmp(Char const   *s1 , Char const   *s2 ) ;
3554 extern Int vgPlain_strcasecmp(Char const   *s1 , Char const   *s2 ) ;   3554 extern Int vgPlain_strcasecmp(Char const   *s1 , Char const   *s2 ) ;
3555 extern Int vgPlain_strncmp(Char const   *s1 , Char const   *s2 , SizeT nmax ) ;   3555 extern Int vgPlain_strncmp(Char const   *s1 , Char const   *s2 , SizeT nmax ) ;
3556 extern Int vgPlain_strncasecmp(Char const   *s1 , Char const   *s2 , SizeT nmax ) ;   3556 extern Int vgPlain_strncasecmp(Char const   *s1 , Char const   *s2 , SizeT nmax ) ;
3557 extern Char *vgPlain_strstr(Char const   *haystack , Char *needle ) ;   3557 extern Char *vgPlain_strstr(Char const   *haystack , Char *needle ) ;
3558 extern Char *vgPlain_strcasestr(Char const   *haystack , Char *needle ) ;   3558 extern Char *vgPlain_strcasestr(Char const   *haystack , Char *needle ) ;
3559 extern Char *vgPlain_strchr(Char const   *s , Char c ) ;   3559 extern Char *vgPlain_strchr(Char const   *s , Char c ) ;
3560 extern Char *vgPlain_strrchr(Char const   *s , Char c ) ;   3560 extern Char *vgPlain_strrchr(Char const   *s , Char c ) ;
3561 extern SizeT vgPlain_strspn(Char const   *s , Char const   *accpt ) ;   3561 extern SizeT vgPlain_strspn(Char const   *s , Char const   *accpt ) ;
3562 extern SizeT vgPlain_strcspn(Char const   *s , char const   *reject ) ;   3562 extern SizeT vgPlain_strcspn(Char const   *s , char const   *reject ) ;
3563 extern Char *vgPlain_strtok_r(Char *s , Char const   *delim , Char **saveptr ) ;   3563 extern Char *vgPlain_strtok_r(Char *s , Char const   *delim , Char **saveptr ) ;
3564 extern Char *vgPlain_strtok(Char *s , Char const   *delim ) ;   3564 extern Char *vgPlain_strtok(Char *s , Char const   *delim ) ;
3565 extern Bool vgPlain_parse_Addr(UChar **ppc , Addr *result ) ;   3565 extern Bool vgPlain_parse_Addr(UChar **ppc , Addr *result ) ;
3566 extern void vgPlain_strncpy_safely(Char *dest , Char const   *src , SizeT ndest ) ;   3566 extern void vgPlain_strncpy_safely(Char *dest , Char const   *src , SizeT ndest ) ;
3567 extern void *vgPlain_memcpy(void *d , void const   *s , SizeT sz ) ;   3567 extern void *vgPlain_memcpy(void *d , void const   *s , SizeT sz ) ;
3568 extern void *vgPlain_memmove(void *d , void const   *s , SizeT sz ) ;   3568 extern void *vgPlain_memmove(void *d , void const   *s , SizeT sz ) ;
3569 extern void *vgPlain_memset(void *s , Int c , SizeT sz ) ;   3569 extern void *vgPlain_memset(void *s , Int c , SizeT sz ) ;
3570 extern Int vgPlain_memcmp(void const   *s1 , void const   *s2 , SizeT n ) ;   3570 extern Int vgPlain_memcmp(void const   *s1 , void const   *s2 , SizeT n ) ;
3571 __inline static void ( __attribute__((__always_inline__)) vgPlain_bzero_inline)(void *s ,   3571 __inline static void ( __attribute__((__always_inline__)) vgPlain_bzero_inline)(void *s ,
3572                                                                                 SizeT sz )   3572                                                                                 SizeT sz )
3573 {   3573 {
3574   UWord *p ;   3574   UWord *p ;
3575   UWord tmp ;   3575   UWord tmp ;
3576   UWord tmp___0 ;   3576   UWord tmp___0 ;
3577   UWord tmp___1 ;   3577   UWord tmp___1 ;
3578   UWord tmp___2 ;   3578   UWord tmp___2 ;
3579   UWord tmp___3 ;   3579   UWord tmp___3 ;
3580   UWord tmp___4 ;   3580   UWord tmp___4 ;
3581   UWord tmp___5 ;   3581   UWord tmp___5 ;
3582   UWord tmp___6 ;   3582   UWord tmp___6 ;
3583   UWord tmp___7 ;   3583   UWord tmp___7 ;
3584   UWord tmp___8 ;   3584   UWord tmp___8 ;
3585   UWord tmp___9 ;   3585   UWord tmp___9 ;
3586   UWord tmp___10 ;   3586   UWord tmp___10 ;
3587   UWord tmp___11 ;   3587   UWord tmp___11 ;
3588   UWord tmp___12 ;   3588   UWord tmp___12 ;
3589   UWord tmp___13 ;   3589   UWord tmp___13 ;
3590   UWord tmp___14 ;   3590   UWord tmp___14 ;
3591   UWord tmp___15 ;   3591   UWord tmp___15 ;
3592   UWord tmp___16 ;   3592   UWord tmp___16 ;
3593   UWord tmp___17 ;   3593   UWord tmp___17 ;
3594   UWord tmp___18 ;   3594   UWord tmp___18 ;
3595   UWord tmp___19 ;   3595   UWord tmp___19 ;
3596   UWord tmp___20 ;   3596   UWord tmp___20 ;
3597   UWord tmp___21 ;   3597   UWord tmp___21 ;
3598   UWord tmp___22 ;   3598   UWord tmp___22 ;
3599   UWord tmp___23 ;   3599   UWord tmp___23 ;
3600   UWord tmp___24 ;   3600   UWord tmp___24 ;
3601   UWord tmp___25 ;   3601   UWord tmp___25 ;
3602   UWord tmp___26 ;   3602   UWord tmp___26 ;
3603   long tmp___27 ;   3603   long tmp___27 ;
3604   long tmp___28 ;   3604   long tmp___28 ;
3605     3605  
3606   {   3606   {
3607   tmp___27 = __builtin_expect((long )(! (! (0UL == (sz & (Addr )(sizeof(UWord ) - 1U))))),   3607   tmp___27 = __builtin_expect((long )(! (! (0UL == (sz & (Addr )(sizeof(UWord ) - 1U))))),
3608                               1L);   3608                               1L);
3609   if (tmp___27) {   3609   if (tmp___27) {
3610     tmp___28 = __builtin_expect((long )(! (! (0UL == ((Addr )s & (Addr )(sizeof(UWord ) - 1U))))),   3610     tmp___28 = __builtin_expect((long )(! (! (0UL == ((Addr )s & (Addr )(sizeof(UWord ) - 1U))))),
3611                                 1L);   3611                                 1L);
3612     if (tmp___28) {   3612     if (tmp___28) {
3613       p = (UWord *)s;   3613       p = (UWord *)s;
3614       switch (sz / (SizeT )sizeof(UWord )) {   3614       switch (sz / (SizeT )sizeof(UWord )) {
3615       case 8UL:   3615       case 8UL:
3616       tmp___5 = 0UL;   3616       tmp___5 = 0UL;
3617       *(p + 7) = tmp___5;   3617       *(p + 7) = tmp___5;
3618       tmp___4 = tmp___5;   3618       tmp___4 = tmp___5;
3619       *(p + 6) = tmp___4;   3619       *(p + 6) = tmp___4;
3620       tmp___3 = tmp___4;   3620       tmp___3 = tmp___4;
3621       *(p + 5) = tmp___3;   3621       *(p + 5) = tmp___3;
3622       tmp___2 = tmp___3;   3622       tmp___2 = tmp___3;
3623       *(p + 4) = tmp___2;   3623       *(p + 4) = tmp___2;
3624       tmp___1 = tmp___2;   3624       tmp___1 = tmp___2;
3625       *(p + 3) = tmp___1;   3625       *(p + 3) = tmp___1;
3626       tmp___0 = tmp___1;   3626       tmp___0 = tmp___1;
3627       *(p + 2) = tmp___0;   3627       *(p + 2) = tmp___0;
3628       tmp = tmp___0;   3628       tmp = tmp___0;
3629       *(p + 1) = tmp;   3629       *(p + 1) = tmp;
3630       *(p + 0) = tmp;   3630       *(p + 0) = tmp;
3631       return;   3631       return;
3632       case 7UL:   3632       case 7UL:
3633       tmp___11 = 0UL;   3633       tmp___11 = 0UL;
3634       *(p + 6) = tmp___11;   3634       *(p + 6) = tmp___11;
3635       tmp___10 = tmp___11;   3635       tmp___10 = tmp___11;
3636       *(p + 5) = tmp___10;   3636       *(p + 5) = tmp___10;
3637       tmp___9 = tmp___10;   3637       tmp___9 = tmp___10;
3638       *(p + 4) = tmp___9;   3638       *(p + 4) = tmp___9;
3639       tmp___8 = tmp___9;   3639       tmp___8 = tmp___9;
3640       *(p + 3) = tmp___8;   3640       *(p + 3) = tmp___8;
3641       tmp___7 = tmp___8;   3641       tmp___7 = tmp___8;
3642       *(p + 2) = tmp___7;   3642       *(p + 2) = tmp___7;
3643       tmp___6 = tmp___7;   3643       tmp___6 = tmp___7;
3644       *(p + 1) = tmp___6;   3644       *(p + 1) = tmp___6;
3645       *(p + 0) = tmp___6;   3645       *(p + 0) = tmp___6;
3646       return;   3646       return;
3647       case 6UL:   3647       case 6UL:
3648       tmp___16 = 0UL;   3648       tmp___16 = 0UL;
3649       *(p + 5) = tmp___16;   3649       *(p + 5) = tmp___16;
3650       tmp___15 = tmp___16;   3650       tmp___15 = tmp___16;
3651       *(p + 4) = tmp___15;   3651       *(p + 4) = tmp___15;
3652       tmp___14 = tmp___15;   3652       tmp___14 = tmp___15;
3653       *(p + 3) = tmp___14;   3653       *(p + 3) = tmp___14;
3654       tmp___13 = tmp___14;   3654       tmp___13 = tmp___14;
3655       *(p + 2) = tmp___13;   3655       *(p + 2) = tmp___13;
3656       tmp___12 = tmp___13;   3656       tmp___12 = tmp___13;
3657       *(p + 1) = tmp___12;   3657       *(p + 1) = tmp___12;
3658       *(p + 0) = tmp___12;   3658       *(p + 0) = tmp___12;
3659       return;   3659       return;
3660       case 5UL:   3660       case 5UL:
3661       tmp___20 = 0UL;   3661       tmp___20 = 0UL;
3662       *(p + 4) = tmp___20;   3662       *(p + 4) = tmp___20;
3663       tmp___19 = tmp___20;   3663       tmp___19 = tmp___20;
3664       *(p + 3) = tmp___19;   3664       *(p + 3) = tmp___19;
3665       tmp___18 = tmp___19;   3665       tmp___18 = tmp___19;
3666       *(p + 2) = tmp___18;   3666       *(p + 2) = tmp___18;
3667       tmp___17 = tmp___18;   3667       tmp___17 = tmp___18;
3668       *(p + 1) = tmp___17;   3668       *(p + 1) = tmp___17;
3669       *(p + 0) = tmp___17;   3669       *(p + 0) = tmp___17;
3670       return;   3670       return;
3671       case 4UL:   3671       case 4UL:
3672       tmp___23 = 0UL;   3672       tmp___23 = 0UL;
3673       *(p + 3) = tmp___23;   3673       *(p + 3) = tmp___23;
3674       tmp___22 = tmp___23;   3674       tmp___22 = tmp___23;
3675       *(p + 2) = tmp___22;   3675       *(p + 2) = tmp___22;
3676       tmp___21 = tmp___22;   3676       tmp___21 = tmp___22;
3677       *(p + 1) = tmp___21;   3677       *(p + 1) = tmp___21;
3678       *(p + 0) = tmp___21;   3678       *(p + 0) = tmp___21;
3679       return;   3679       return;
3680       case 3UL:   3680       case 3UL:
3681       tmp___25 = 0UL;   3681       tmp___25 = 0UL;
3682       *(p + 2) = tmp___25;   3682       *(p + 2) = tmp___25;
3683       tmp___24 = tmp___25;   3683       tmp___24 = tmp___25;
3684       *(p + 1) = tmp___24;   3684       *(p + 1) = tmp___24;
3685       *(p + 0) = tmp___24;   3685       *(p + 0) = tmp___24;
3686       return;   3686       return;
3687       case 2UL:   3687       case 2UL:
3688       tmp___26 = 0UL;   3688       tmp___26 = 0UL;
3689       *(p + 1) = tmp___26;   3689       *(p + 1) = tmp___26;
3690       *(p + 0) = tmp___26;   3690       *(p + 0) = tmp___26;
3691       return;   3691       return;
3692       case 1UL:   3692       case 1UL:
3693       *(p + 0) = 0UL;   3693       *(p + 0) = 0UL;
3694       return;   3694       return;
3695       case 0UL:   3695       case 0UL:
3696       return;   3696       return;
3697       default:   3697       default:
3698       break;   3698       break;
3699       }   3699       }
3700     } else {   3700     } else {
3701     3701  
3702     }   3702     }
3703   } else {   3703   } else {
3704     3704  
3705   }   3705   }
3706   vgPlain_memset(s, 0, sz);   3706   vgPlain_memset(s, 0, sz);
3707   return;   3707   return;
3708 }   3708 }
3709 }   3709 }
3710 extern void vgPlain_ssort(void *base , SizeT nmemb , SizeT size ,   3710 extern void vgPlain_ssort(void *base , SizeT nmemb , SizeT size ,
3711                           Int (*compar)(void * , void * ) ) ;   3711                           Int (*compar)(void * , void * ) ) ;
3712 extern Int vgPlain_log2(UInt x ) ;   3712 extern Int vgPlain_log2(UInt x ) ;
3713 extern Int vgPlain_log2_64(ULong x ) ;   3713 extern Int vgPlain_log2_64(ULong x ) ;
3714 extern UInt vgPlain_random(UInt *pSeed ) ;   3714 extern UInt vgPlain_random(UInt *pSeed ) ;
3715 __inline static UWord address_lsb(Addr const   a )   3715 __inline static UWord address_lsb(Addr const   a )
3716 {   3716 {
3717     3717  
3718     3718  
3719   {   3719   {
3720   return ((UWord )(a & (unsigned long const   )((1UL << 12) - 1UL)));   3720   return ((UWord )(a & (unsigned long const   )((1UL << 12) - 1UL)));
3721 }   3721 }
3722 }   3722 }
3723 __inline static Addr first_address_with_same_lsb(Addr const   a )   3723 __inline static Addr first_address_with_same_lsb(Addr const   a )
3724 {   3724 {
3725     3725  
3726     3726  
3727   {   3727   {
3728   return ((Addr )a);   3728   return ((Addr )a);
3729 }   3729 }
3730 }   3730 }
3731 __inline static Addr first_address_with_higher_lsb(Addr const   a )   3731 __inline static Addr first_address_with_higher_lsb(Addr const   a )
3732 {   3732 {
3733     3733  
3734     3734  
3735   {   3735   {
3736   return ((Addr )(a + 1UL));   3736   return ((Addr )(a + 1UL));
3737 }   3737 }
3738 }   3738 }
3739 __inline static UWord address_msb(Addr const   a )   3739 __inline static UWord address_msb(Addr const   a )
3740 {   3740 {
3741     3741  
3742     3742  
3743   {   3743   {
3744   return ((UWord )(a >> 12));   3744   return ((UWord )(a >> 12));
3745 }   3745 }
3746 }   3746 }
3747 __inline static Addr first_address_with_higher_msb(Addr const   a )   3747 __inline static Addr first_address_with_higher_msb(Addr const   a )
3748 {   3748 {
3749     3749  
3750     3750  
3751   {   3751   {
3752   return ((Addr )((a | (unsigned long const   )((1UL << 12) - 1UL)) + 1UL));   3752   return ((Addr )((a | (unsigned long const   )((1UL << 12) - 1UL)) + 1UL));
3753 }   3753 }
3754 }   3754 }
3755 __inline static Addr make_address(UWord const   a1 , UWord const   a0 )   3755 __inline static Addr make_address(UWord const   a1 , UWord const   a0 )
3756 {   3756 {
3757     3757  
3758     3758  
3759   {   3759   {
3760   return ((Addr )((a1 << 12) | a0));   3760   return ((Addr )((a1 << 12) | a0));
3761 }   3761 }
3762 }   3762 }
3763 __inline static UWord uword_msb(UWord const   a )   3763 __inline static UWord uword_msb(UWord const   a )
3764 {   3764 {
3765     3765  
3766     3766  
3767   {   3767   {
3768   return ((UWord )(a >> 5));   3768   return ((UWord )(a >> 5));
3769 }   3769 }
3770 }   3770 }
3771 __inline static UWord uword_lsb(UWord const   a )   3771 __inline static UWord uword_lsb(UWord const   a )
3772 {   3772 {
3773     3773  
3774     3774  
3775   {   3775   {
3776   return ((UWord )(a & (unsigned long const   )((1UL << 5) - 1UL)));   3776   return ((UWord )(a & (unsigned long const   )((1UL << 5) - 1UL)));
3777 }   3777 }
3778 }   3778 }
3779 __inline static Addr first_address_with_same_uword_lsb(Addr const   a )   3779 __inline static Addr first_address_with_same_uword_lsb(Addr const   a )
3780 {   3780 {
3781     3781  
3782     3782  
3783   {   3783   {
3784   return ((Addr )(a & (unsigned long const   )(~ ((1UL << 5) - 1UL))));   3784   return ((Addr )(a & (unsigned long const   )(~ ((1UL << 5) - 1UL))));
3785 }   3785 }
3786 }   3786 }
3787 __inline static Addr first_address_with_higher_uword_msb(Addr const   a )   3787 __inline static Addr first_address_with_higher_uword_msb(Addr const   a )
3788 {   3788 {
3789     3789  
3790     3790  
3791   {   3791   {
3792   return ((Addr )((a | (unsigned long const   )((1UL << 5) - 1UL)) + 1UL));   3792   return ((Addr )((a | (unsigned long const   )((1UL << 5) - 1UL)) + 1UL));
3793 }   3793 }
3794 }   3794 }
3795 static ULong s_bitmap2_creation_count  ;   3795 static ULong s_bitmap2_creation_count  ;
3796 __inline static UWord bm0_mask(UWord const   a )   3796 __inline static UWord bm0_mask(UWord const   a )
3797 {   3797 {
3798   UWord tmp ;   3798   UWord tmp ;
3799     3799  
3800   {   3800   {
3801   tmp = uword_lsb(a);   3801   tmp = uword_lsb(a);
3802   return (1UL << tmp);   3802   return (1UL << tmp);
3803 }   3803 }
3804 }   3804 }
3805 __inline static void bm0_set(UWord *bm0 , UWord const   a )   3805 __inline static void bm0_set(UWord *bm0 , UWord const   a )
3806 {   3806 {
3807   UWord tmp ;   3807   UWord tmp ;
3808   UWord tmp___0 ;   3808   UWord tmp___0 ;
3809     3809  
3810   {   3810   {
3811   tmp = uword_msb(a);   3811   tmp = uword_msb(a);
3812   tmp___0 = uword_lsb(a);   3812   tmp___0 = uword_lsb(a);
3813   *(bm0 + tmp) |= 1UL << tmp___0;   3813   *(bm0 + tmp) |= 1UL << tmp___0;
3814   return;   3814   return;
3815 }   3815 }
3816 }   3816 }
3817 __inline static void bm0_set_range(UWord *bm0 , UWord const   a ,   3817 __inline static void bm0_set_range(UWord *bm0 , UWord const   a ,
3818                                    SizeT const   size )   3818                                    SizeT const   size )
3819 {   3819 {
3820   UWord tmp ;   3820   UWord tmp ;
3821   UWord tmp___0 ;   3821   UWord tmp___0 ;
3822     3822  
3823   {   3823   {
3824   tmp = uword_msb(a);   3824   tmp = uword_msb(a);
3825   tmp___0 = uword_lsb(a);   3825   tmp___0 = uword_lsb(a);
3826   *(bm0 + tmp) |= ((1UL << size) - 1UL) << tmp___0;   3826   *(bm0 + tmp) |= ((1UL << size) - 1UL) << tmp___0;
3827   return;   3827   return;
3828 }   3828 }
3829 }   3829 }
3830 __inline static void bm0_clear(UWord *bm0 , UWord const   a )   3830 __inline static void bm0_clear(UWord *bm0 , UWord const   a )
3831 {   3831 {
3832   UWord tmp ;   3832   UWord tmp ;
3833   UWord tmp___0 ;   3833   UWord tmp___0 ;
3834     3834  
3835   {   3835   {
3836   tmp = uword_msb(a);   3836   tmp = uword_msb(a);
3837   tmp___0 = uword_lsb(a);   3837   tmp___0 = uword_lsb(a);
3838   *(bm0 + tmp) &= ~ (1UL << tmp___0);   3838   *(bm0 + tmp) &= ~ (1UL << tmp___0);
3839   return;   3839   return;
3840 }   3840 }
3841 }   3841 }
3842 __inline static void bm0_clear_range(UWord *bm0 , UWord const   a ,   3842 __inline static void bm0_clear_range(UWord *bm0 , UWord const   a ,
3843                                      SizeT const   size )   3843                                      SizeT const   size )
3844 {   3844 {
3845   UWord tmp ;   3845   UWord tmp ;
3846   UWord tmp___0 ;   3846   UWord tmp___0 ;
3847     3847  
3848   {   3848   {
3849   if (size > 0UL) {   3849   if (size > 0UL) {
3850     tmp = uword_msb(a);   3850     tmp = uword_msb(a);
3851     tmp___0 = uword_lsb(a);   3851     tmp___0 = uword_lsb(a);
3852     *(bm0 + tmp) &= ~ (((1UL << size) - 1UL) << tmp___0);   3852     *(bm0 + tmp) &= ~ (((1UL << size) - 1UL) << tmp___0);
3853   } else {   3853   } else {
3854     3854  
3855   }   3855   }
3856   return;   3856   return;
3857 }   3857 }
3858 }   3858 }
3859 __inline static UWord bm0_is_set(UWord const   *bm0 , UWord const   a )   3859 __inline static UWord bm0_is_set(UWord const   *bm0 , UWord const   a )
3860 {   3860 {
3861   UWord tmp ;   3861   UWord tmp ;
3862   UWord tmp___0 ;   3862   UWord tmp___0 ;
3863     3863  
3864   {   3864   {
3865   tmp = uword_msb(a);   3865   tmp = uword_msb(a);
3866   tmp___0 = uword_lsb(a);   3866   tmp___0 = uword_lsb(a);
3867   return ((UWord )(*(bm0 + tmp) & (unsigned long const   )(1UL << tmp___0)));   3867   return ((UWord )(*(bm0 + tmp) & (unsigned long const   )(1UL << tmp___0)));
3868 }   3868 }
3869 }   3869 }
3870 __inline static UWord bm0_is_any_set(UWord const   *bm0 , Addr const   a ,   3870 __inline static UWord bm0_is_any_set(UWord const   *bm0 , Addr const   a ,
3871                                      SizeT const   size )   3871                                      SizeT const   size )
3872 {   3872 {
3873   UWord tmp ;   3873   UWord tmp ;
3874   UWord tmp___0 ;   3874   UWord tmp___0 ;
3875     3875  
3876   {   3876   {
3877   tmp = uword_msb(a);   3877   tmp = uword_msb(a);
3878   tmp___0 = uword_lsb(a);   3878   tmp___0 = uword_lsb(a);
3879   return ((UWord )(*(bm0 + tmp) & (unsigned long const   )(((1UL << size) - 1UL) << tmp___0)));   3879   return ((UWord )(*(bm0 + tmp) & (unsigned long const   )(((1UL << size) - 1UL) << tmp___0)));
3880 }   3880 }
3881 }   3881 }
3882 __inline static void bm2_clear(struct bitmap2 * const  bm2 ) ;   3882 __inline static void bm2_clear(struct bitmap2 * const  bm2 ) ;
3883 __inline static struct bitmap2 *bm2_insert(struct bitmap * const  bm ,   3883 __inline static struct bitmap2 *bm2_insert(struct bitmap * const  bm ,
3884                                            UWord const   a1 ) ;   3884                                            UWord const   a1 ) ;
3885 __inline static void bm_cache_rotate(struct bm_cache_elem *cache ,   3885 __inline static void bm_cache_rotate(struct bm_cache_elem *cache ,
3886                                      int const   n )   3886                                      int const   n )
3887 {   3887 {
3888     3888  
3889     3889  
3890   {   3890   {
3891   return;   3891   return;
3892 }   3892 }
3893 }   3893 }
3894 __inline static Bool bm_cache_lookup(struct bitmap * const  bm ,   3894 __inline static Bool bm_cache_lookup(struct bitmap * const  bm ,
3895                                      UWord const   a1 , struct bitmap2 **bm2 )   3895                                      UWord const   a1 , struct bitmap2 **bm2 )
3896 {   3896 {
3897     3897  
3898     3898  
3899   {   3899   {
3900   if (a1 == (UWord const   )bm->cache[0].a1) {   3900   if (a1 == (UWord const   )bm->cache[0].a1) {
3901     *bm2 = bm->cache[0].bm2;   3901     *bm2 = bm->cache[0].bm2;
3902     return ((Bool )1);   3902     return ((Bool )1);
3903   } else {   3903   } else {
3904     3904  
3905   }   3905   }
3906   if (a1 == (UWord const   )bm->cache[1].a1) {   3906   if (a1 == (UWord const   )bm->cache[1].a1) {
3907     *bm2 = bm->cache[1].bm2;   3907     *bm2 = bm->cache[1].bm2;
3908     return ((Bool )1);   3908     return ((Bool )1);
3909   } else {   3909   } else {
3910     3910  
3911   }   3911   }
3912   if (a1 == (UWord const   )bm->cache[2].a1) {   3912   if (a1 == (UWord const   )bm->cache[2].a1) {
3913     *bm2 = bm->cache[2].bm2;   3913     *bm2 = bm->cache[2].bm2;
3914     bm_cache_rotate(bm->cache, (int const   )3);   3914     bm_cache_rotate(bm->cache, (int const   )3);
3915     return ((Bool )1);   3915     return ((Bool )1);
3916   } else {   3916   } else {
3917     3917  
3918   }   3918   }
3919   if (a1 == (UWord const   )bm->cache[3].a1) {   3919   if (a1 == (UWord const   )bm->cache[3].a1) {
3920     *bm2 = bm->cache[3].bm2;   3920     *bm2 = bm->cache[3].bm2;
3921     bm_cache_rotate(bm->cache, (int const   )4);   3921     bm_cache_rotate(bm->cache, (int const   )4);
3922     return ((Bool )1);   3922     return ((Bool )1);
3923   } else {   3923   } else {
3924     3924  
3925   }   3925   }
3926   *bm2 = (struct bitmap2 *)0;   3926   *bm2 = (struct bitmap2 *)0;
3927   return ((Bool )0);   3927   return ((Bool )0);
3928 }   3928 }
3929 }   3929 }
3930 __inline static void bm_update_cache(struct bitmap * const  bm ,   3930 __inline static void bm_update_cache(struct bitmap * const  bm ,
3931                                      UWord const   a1 ,   3931                                      UWord const   a1 ,
3932                                      struct bitmap2 * const  bm2 )   3932                                      struct bitmap2 * const  bm2 )
3933 {   3933 {
3934     3934  
3935     3935  
3936   {   3936   {
3937   bm->cache[3] = bm->cache[2];   3937   bm->cache[3] = bm->cache[2];
3938   bm->cache[2] = bm->cache[1];   3938   bm->cache[2] = bm->cache[1];
3939   bm->cache[1] = bm->cache[0];   3939   bm->cache[1] = bm->cache[0];
3940   bm->cache[0].a1 = (Addr )a1;   3940   bm->cache[0].a1 = (Addr )a1;
3941   bm->cache[0].bm2 = (struct bitmap2 *)bm2;   3941   bm->cache[0].bm2 = (struct bitmap2 *)bm2;
3942   return;   3942   return;
3943 }   3943 }
3944 }   3944 }
3945 __inline static struct bitmap2  const  *bm2_lookup(struct bitmap * const  bm ,   3945 __inline static struct bitmap2  const  *bm2_lookup(struct bitmap * const  bm ,
3946                                                    UWord const   a1 )   3946                                                    UWord const   a1 )
3947 {   3947 {
3948   struct bitmap2 *bm2 ;   3948   struct bitmap2 *bm2 ;
3949   void *tmp ;   3949   void *tmp ;
3950   Bool tmp___0 ;   3950   Bool tmp___0 ;
3951     3951  
3952   {   3952   {
3953   tmp___0 = bm_cache_lookup(bm, a1, & bm2);   3953   tmp___0 = bm_cache_lookup(bm, a1, & bm2);
3954   if (tmp___0) {   3954   if (tmp___0) {
3955     3955  
3956   } else {   3956   } else {
3957     tmp = vgPlain_OSetGen_Lookup((OSet const   *)bm->oset,   3957     tmp = vgPlain_OSetGen_Lookup((OSet const   *)bm->oset,
3958                                  (void const   *)(& a1));   3958                                  (void const   *)(& a1));
3959     bm2 = (struct bitmap2 *)tmp;   3959     bm2 = (struct bitmap2 *)tmp;
3960     bm_update_cache(bm, a1, (struct bitmap2 */* const  */)bm2);   3960     bm_update_cache(bm, a1, (struct bitmap2 */* const  */)bm2);
3961   }   3961   }
3962   return ((struct bitmap2  const  *)bm2);   3962   return ((struct bitmap2  const  *)bm2);
3963 }   3963 }
3964 }   3964 }
3965 __inline static struct bitmap2 *bm2_lookup_exclusive(struct bitmap * const  bm ,   3965 __inline static struct bitmap2 *bm2_lookup_exclusive(struct bitmap * const  bm ,
3966                                                      UWord const   a1 )   3966                                                      UWord const   a1 )
3967 {   3967 {
3968   struct bitmap2 *bm2 ;   3968   struct bitmap2 *bm2 ;
3969   void *tmp ;   3969   void *tmp ;
3970   Bool tmp___0 ;   3970   Bool tmp___0 ;
3971     3971  
3972   {   3972   {
3973   tmp___0 = bm_cache_lookup(bm, a1, & bm2);   3973   tmp___0 = bm_cache_lookup(bm, a1, & bm2);
3974   if (tmp___0) {   3974   if (tmp___0) {
3975     3975  
3976   } else {   3976   } else {
3977     tmp = vgPlain_OSetGen_Lookup((OSet const   *)bm->oset,   3977     tmp = vgPlain_OSetGen_Lookup((OSet const   *)bm->oset,
3978                                  (void const   *)(& a1));   3978                                  (void const   *)(& a1));
3979     bm2 = (struct bitmap2 *)tmp;   3979     bm2 = (struct bitmap2 *)tmp;
3980   }   3980   }
3981   return (bm2);   3981   return (bm2);
3982 }   3982 }
3983 }   3983 }
3984 __inline static void bm2_clear(struct bitmap2 * const  bm2 )   3984 __inline static void bm2_clear(struct bitmap2 * const  bm2 )
3985 {   3985 {
3986     3986  
3987     3987  
3988   {   3988   {
3989   vgPlain_memset((void *)(& bm2->bm1), 0, (SizeT )sizeof(bm2->bm1));   3989   vgPlain_memset((void *)(& bm2->bm1), 0, (SizeT )sizeof(bm2->bm1));
3990   return;   3990   return;
3991 }   3991 }
3992 }   3992 }
3993 __inline static struct bitmap2 *bm2_insert(struct bitmap * const  bm ,   3993 __inline static struct bitmap2 *bm2_insert(struct bitmap * const  bm ,
3994                                            UWord const   a1 )   3994                                            UWord const   a1 )
3995 {   3995 {
3996   struct bitmap2 *bm2 ;   3996   struct bitmap2 *bm2 ;
3997   void *tmp ;   3997   void *tmp ;
3998     3998  
3999   {   3999   {
4000   s_bitmap2_creation_count ++;   4000   s_bitmap2_creation_count ++;
4001   tmp = vgPlain_OSetGen_AllocNode(bm->oset, (SizeT )sizeof(*bm2));   4001   tmp = vgPlain_OSetGen_AllocNode(bm->oset, (SizeT )sizeof(*bm2));
4002   bm2 = (struct bitmap2 *)tmp;   4002   bm2 = (struct bitmap2 *)tmp;
4003   bm2->addr = (Addr )a1;   4003   bm2->addr = (Addr )a1;
4004   vgPlain_OSetGen_Insert(bm->oset, (void *)bm2);   4004   vgPlain_OSetGen_Insert(bm->oset, (void *)bm2);
4005   bm_update_cache(bm, a1, (struct bitmap2 */* const  */)bm2);   4005   bm_update_cache(bm, a1, (struct bitmap2 */* const  */)bm2);
4006   return (bm2);   4006   return (bm2);
4007 }   4007 }
4008 }   4008 }
4009 __inline static struct bitmap2 *bm2_insert_copy(struct bitmap * const  bm ,   4009 __inline static struct bitmap2 *bm2_insert_copy(struct bitmap * const  bm ,
4010                                                 struct bitmap2 * const  bm2 )   4010                                                 struct bitmap2 * const  bm2 )
4011 {   4011 {
4012   struct bitmap2 *bm2_copy ;   4012   struct bitmap2 *bm2_copy ;
4013     4013  
4014   {   4014   {
4015   bm2_copy = bm2_insert(bm, (UWord const   )bm2->addr);   4015   bm2_copy = bm2_insert(bm, (UWord const   )bm2->addr);
4016   vgPlain_memcpy((void *)(& bm2_copy->bm1), (void const   *)(& bm2->bm1),   4016   vgPlain_memcpy((void *)(& bm2_copy->bm1), (void const   *)(& bm2->bm1),
4017                  (SizeT )sizeof(bm2->bm1));   4017                  (SizeT )sizeof(bm2->bm1));
4018   return (bm2_copy);   4018   return (bm2_copy);
4019 }   4019 }
4020 }   4020 }
4021 __inline static struct bitmap2 *bm2_lookup_or_insert(struct bitmap * const  bm ,   4021 __inline static struct bitmap2 *bm2_lookup_or_insert(struct bitmap * const  bm ,
4022                                                      UWord const   a1 )   4022                                                      UWord const   a1 )
4023 {   4023 {
4024   struct bitmap2 *bm2 ;   4024   struct bitmap2 *bm2 ;
4025   void *tmp ;   4025   void *tmp ;
4026   Bool tmp___0 ;   4026   Bool tmp___0 ;
4027     4027  
4028   {   4028   {
4029   tmp___0 = bm_cache_lookup(bm, a1, & bm2);   4029   tmp___0 = bm_cache_lookup(bm, a1, & bm2);
4030   if (tmp___0) {   4030   if (tmp___0) {
4031     if ((unsigned int )bm2 == (unsigned int )((struct bitmap2 *)0)) {   4031     if ((unsigned int )bm2 == (unsigned int )((struct bitmap2 *)0)) {
4032       bm2 = bm2_insert(bm, a1);   4032       bm2 = bm2_insert(bm, a1);
4033       bm2_clear((struct bitmap2 */* const  */)bm2);   4033       bm2_clear((struct bitmap2 */* const  */)bm2);
4034     } else {   4034     } else {
4035     4035  
4036     }   4036     }
4037   } else {   4037   } else {
4038     tmp = vgPlain_OSetGen_Lookup((OSet const   *)bm->oset,   4038     tmp = vgPlain_OSetGen_Lookup((OSet const   *)bm->oset,
4039                                  (void const   *)(& a1));   4039                                  (void const   *)(& a1));
4040     bm2 = (struct bitmap2 *)tmp;   4040     bm2 = (struct bitmap2 *)tmp;
4041     if (! bm2) {   4041     if (! bm2) {
4042       bm2 = bm2_insert(bm, a1);   4042       bm2 = bm2_insert(bm, a1);
4043       bm2_clear((struct bitmap2 */* const  */)bm2);   4043       bm2_clear((struct bitmap2 */* const  */)bm2);
4044     } else {   4044     } else {
4045     4045  
4046     }   4046     }
4047     bm_update_cache(bm, a1, (struct bitmap2 */* const  */)bm2);   4047     bm_update_cache(bm, a1, (struct bitmap2 */* const  */)bm2);
4048   }   4048   }
4049   return (bm2);   4049   return (bm2);
4050 }   4050 }
4051 }   4051 }
4052 __inline static struct bitmap2 *bm2_lookup_or_insert_exclusive(struct bitmap * const  bm ,   4052 __inline static struct bitmap2 *bm2_lookup_or_insert_exclusive(struct bitmap * const  bm ,
4053                                                                UWord const   a1 )   4053                                                                UWord const   a1 )
4054 {   4054 {
4055   struct bitmap2 *tmp ;   4055   struct bitmap2 *tmp ;
4056     4056  
4057   {   4057   {
4058   tmp = bm2_lookup_or_insert(bm, a1);   4058   tmp = bm2_lookup_or_insert(bm, a1);
4059   return (tmp);   4059   return (tmp);
4060 }   4060 }
4061 }   4061 }
4062 __inline static void bm2_remove(struct bitmap * const  bm , UWord const   a1 )   4062 __inline static void bm2_remove(struct bitmap * const  bm , UWord const   a1 )
4063 {   4063 {
4064   struct bitmap2 *bm2 ;   4064   struct bitmap2 *bm2 ;
4065   void *tmp ;   4065   void *tmp ;
4066     4066  
4067   {   4067   {
4068   tmp = vgPlain_OSetGen_Remove(bm->oset, (void const   *)(& a1));   4068   tmp = vgPlain_OSetGen_Remove(bm->oset, (void const   *)(& a1));
4069   bm2 = (struct bitmap2 *)tmp;   4069   bm2 = (struct bitmap2 *)tmp;
4070   vgPlain_OSetGen_FreeNode(bm->oset, (void *)bm2);   4070   vgPlain_OSetGen_FreeNode(bm->oset, (void *)bm2);
4071   bm_update_cache(bm, a1, (struct bitmap2 */* const  */)((void *)0));   4071   bm_update_cache(bm, a1, (struct bitmap2 */* const  */)((void *)0));
4072   return;   4072   return;
4073 }   4073 }
4074 }   4074 }
4075 __inline static void bm_access_aligned_load(struct bitmap * const  bm ,   4075 __inline static void bm_access_aligned_load(struct bitmap * const  bm ,
4076                                             Addr const   a1 ,   4076                                             Addr const   a1 ,
4077                                             SizeT const   size )   4077                                             SizeT const   size )
4078 {   4078 {
4079   struct bitmap2 *bm2 ;   4079   struct bitmap2 *bm2 ;
4080   UWord tmp ;   4080   UWord tmp ;
4081     4081  
4082   {   4082   {
4083   tmp = address_msb(a1);   4083   tmp = address_msb(a1);
4084   bm2 = bm2_lookup_or_insert_exclusive(bm, (UWord const   )tmp);   4084   bm2 = bm2_lookup_or_insert_exclusive(bm, (UWord const   )tmp);
    -+ 4085   {
      4086   if (1UL << 12 < 2) {
      4087     return;
      4088   }
      4089   if (size < 2) {
      4090     return;
      4091   }
4085   bm0_set_range(bm2->bm1.bm0_r, = 4092   bm0_set_range(bm2->bm1.bm0_r,
4086                 a1 & (unsigned long const   )((1UL << 12) - 1UL),   4093                 a1 & (unsigned long const   )((1UL << 12) - 1UL),
4087                 (size - 1UL) + 1UL);   4094                 (size - 1UL) + 1UL);
    -+ 4095   }
4088   return; = 4096   return;
4089 }   4097 }
4090 }   4098 }
4091 __inline static void bm_access_aligned_store(struct bitmap * const  bm ,   4099 __inline static void bm_access_aligned_store(struct bitmap * const  bm ,
4092                                              Addr const   a1 ,   4100                                              Addr const   a1 ,
4093                                              SizeT const   size )   4101                                              SizeT const   size )
4094 {   4102 {
4095   struct bitmap2 *bm2 ;   4103   struct bitmap2 *bm2 ;
4096   UWord tmp ;   4104   UWord tmp ;
4097     4105  
4098   {   4106   {
4099   tmp = address_msb(a1);   4107   tmp = address_msb(a1);
4100   bm2 = bm2_lookup_or_insert_exclusive(bm, (UWord const   )tmp);   4108   bm2 = bm2_lookup_or_insert_exclusive(bm, (UWord const   )tmp);
    -+ 4109   {
      4110   if (1UL << 12 < 2) {
      4111     return;
      4112   }
      4113   if (size < 2) {
      4114     return;
      4115   }
4101   bm0_set_range(bm2->bm1.bm0_w, = 4116   bm0_set_range(bm2->bm1.bm0_w,
4102                 a1 & (unsigned long const   )((1UL << 12) - 1UL),   4117                 a1 & (unsigned long const   )((1UL << 12) - 1UL),
4103                 (size - 1UL) + 1UL);   4118                 (size - 1UL) + 1UL);
    -+ 4119   }
4104   return; = 4120   return;
4105 }   4121 }
4106 }   4122 }
4107 __inline static Bool bm_aligned_load_has_conflict_with(struct bitmap * const  bm ,   4123 __inline static Bool bm_aligned_load_has_conflict_with(struct bitmap * const  bm ,
4108                                                        Addr const   a ,   4124                                                        Addr const   a ,
4109                                                        SizeT const   size )   4125                                                        SizeT const   size )
4110 {   4126 {
4111   struct bitmap2  const  *bm2 ;   4127   struct bitmap2  const  *bm2 ;
4112   UWord tmp ;   4128   UWord tmp ;
4113   UWord tmp___0 ;   4129   UWord tmp___0 ;
4114   UWord tmp___1 ;   4130   UWord tmp___1 ;
4115   int tmp___2 ;   4131   int tmp___2 ;
4116     4132  
4117   {   4133   {
4118   tmp = address_msb(a);   4134   tmp = address_msb(a);
4119   bm2 = bm2_lookup(bm, (UWord const   )tmp);   4135   bm2 = bm2_lookup(bm, (UWord const   )tmp);
4120   if (bm2) {   4136   if (bm2) {
4121     tmp___0 = address_lsb(a);   4137     tmp___0 = address_lsb(a);
4122     tmp___1 = bm0_is_any_set((UWord const   *)(bm2->bm1.bm0_w),   4138     tmp___1 = bm0_is_any_set((UWord const   *)(bm2->bm1.bm0_w),
4123                              (Addr const   )tmp___0, (size - 1UL) + 1UL);   4139                              (Addr const   )tmp___0, (size - 1UL) + 1UL);
4124     if (tmp___1) {   4140     if (tmp___1) {
4125       tmp___2 = 1;   4141       tmp___2 = 1;
4126     } else {   4142     } else {
4127       tmp___2 = 0;   4143       tmp___2 = 0;
4128     }   4144     }
4129   } else {   4145   } else {
4130     tmp___2 = 0;   4146     tmp___2 = 0;
4131   }   4147   }
4132   return ((Bool )tmp___2);   4148   return ((Bool )tmp___2);
4133 }   4149 }
4134 }   4150 }
4135 __inline static Bool bm_aligned_store_has_conflict_with(struct bitmap * const  bm ,   4151 __inline static Bool bm_aligned_store_has_conflict_with(struct bitmap * const  bm ,
4136                                                         Addr const   a ,   4152                                                         Addr const   a ,
4137                                                         SizeT const   size )   4153                                                         SizeT const   size )
4138 {   4154 {
4139   struct bitmap2  const  *bm2 ;   4155   struct bitmap2  const  *bm2 ;
4140   UWord tmp ;   4156   UWord tmp ;
4141   UWord tmp___0 ;   4157   UWord tmp___0 ;
4142   UWord tmp___1 ;   4158   UWord tmp___1 ;
4143   UWord tmp___2 ;   4159   UWord tmp___2 ;
4144   UWord tmp___3 ;   4160   UWord tmp___3 ;
4145     4161  
4146   {   4162   {
4147   tmp = address_msb(a);   4163   tmp = address_msb(a);
4148   bm2 = bm2_lookup(bm, (UWord const   )tmp);   4164   bm2 = bm2_lookup(bm, (UWord const   )tmp);
4149   if (bm2) {   4165   if (bm2) {
4150     tmp___0 = address_lsb(a);   4166     tmp___0 = address_lsb(a);
4151     tmp___1 = bm0_is_any_set((UWord const   *)(bm2->bm1.bm0_r),   4167     tmp___1 = bm0_is_any_set((UWord const   *)(bm2->bm1.bm0_r),
4152                              (Addr const   )tmp___0, (size - 1UL) + 1UL);   4168                              (Addr const   )tmp___0, (size - 1UL) + 1UL);
4153     tmp___2 = address_lsb(a);   4169     tmp___2 = address_lsb(a);
4154     tmp___3 = bm0_is_any_set((UWord const   *)(bm2->bm1.bm0_w),   4170     tmp___3 = bm0_is_any_set((UWord const   *)(bm2->bm1.bm0_w),
4155                              (Addr const   )tmp___2, (size - 1UL) + 1UL);   4171                              (Addr const   )tmp___2, (size - 1UL) + 1UL);
4156     if (tmp___1 | tmp___3) {   4172     if (tmp___1 | tmp___3) {
4157       return ((Bool )1);   4173       return ((Bool )1);
4158     } else {   4174     } else {
4159     4175  
4160     }   4176     }
4161   } else {   4177   } else {
4162     4178  
4163   }   4179   }
4164   return ((Bool )0);   4180   return ((Bool )0);
4165 }   4181 }
4166 }   4182 }
4167 extern  __attribute__((__noreturn__)) void vgPlain_exit(Int status ) ;   4183 extern  __attribute__((__noreturn__)) void vgPlain_exit(Int status ) ;
4168 extern  __attribute__((__noreturn__)) void vgPlain_tool_panic(Char *str ) ;   4184 extern  __attribute__((__noreturn__)) void vgPlain_tool_panic(Char *str ) ;
4169 extern  __attribute__((__noreturn__)) void vgPlain_assert_fail(Bool isCore ,   4185 extern  __attribute__((__noreturn__)) void vgPlain_assert_fail(Bool isCore ,
4170                                                                Char const   *expr ,   4186                                                                Char const   *expr ,
4171                                                                Char const   *file ,   4187                                                                Char const   *file ,
4172                                                                Int line ,   4188                                                                Int line ,
4173                                                                Char const   *fn ,   4189                                                                Char const   *fn ,
4174                                                                HChar const   *format   4190                                                                HChar const   *format
4175                                                                , ...) ;   4191                                                                , ...) ;
4176 void vgDrd_vc_init(VectorClock * const  vc , VCElem const   * const  vcelem ,   4192 void vgDrd_vc_init(VectorClock * const  vc , VCElem const   * const  vcelem ,
4177                    unsigned int const   size ) ;   4193                    unsigned int const   size ) ;
4178 void vgDrd_vc_cleanup(VectorClock * const  vc ) ;   4194 void vgDrd_vc_cleanup(VectorClock * const  vc ) ;
4179 void vgDrd_vc_copy(VectorClock * const  new , VectorClock const   * const  rhs ) ;   4195 void vgDrd_vc_copy(VectorClock * const  new , VectorClock const   * const  rhs ) ;
4180 void vgDrd_vc_assign(VectorClock * const  lhs ,   4196 void vgDrd_vc_assign(VectorClock * const  lhs ,
4181                      VectorClock const   * const  rhs ) ;   4197                      VectorClock const   * const  rhs ) ;
4182 void vgDrd_vc_increment(VectorClock * const  vc , DrdThreadId const   tid ) ;   4198 void vgDrd_vc_increment(VectorClock * const  vc , DrdThreadId const   tid ) ;
4183 __inline static Bool vgDrd_vc_lte(VectorClock const   * const  vc1 ,   4199 __inline static Bool vgDrd_vc_lte(VectorClock const   * const  vc1 ,
4184                                   VectorClock const   * const  vc2 ) ;   4200                                   VectorClock const   * const  vc2 ) ;
4185 Bool vgDrd_vc_ordered(VectorClock const   * const  vc1 ,   4201 Bool vgDrd_vc_ordered(VectorClock const   * const  vc1 ,
4186                       VectorClock const   * const  vc2 ) ;   4202                       VectorClock const   * const  vc2 ) ;
4187 void vgDrd_vc_min(VectorClock * const  result ,   4203 void vgDrd_vc_min(VectorClock * const  result ,
4188                   VectorClock const   * const  rhs ) ;   4204                   VectorClock const   * const  rhs ) ;
4189 void vgDrd_vc_combine(VectorClock * const  result ,   4205 void vgDrd_vc_combine(VectorClock * const  result ,
4190                       VectorClock const   * const  rhs ) ;   4206                       VectorClock const   * const  rhs ) ;
4191 void vgDrd_vc_print(VectorClock const   * const  vc ) ;   4207 void vgDrd_vc_print(VectorClock const   * const  vc ) ;
4192 char *vgDrd_vc_aprint(VectorClock const   * const  vc ) ;   4208 char *vgDrd_vc_aprint(VectorClock const   * const  vc ) ;
4193 void vgDrd_vc_check(VectorClock const   * const  vc ) ;   4209 void vgDrd_vc_check(VectorClock const   * const  vc ) ;
4194 extern void vgDrd_vc_test(void) ;   4210 extern void vgDrd_vc_test(void) ;
4195 __inline static Bool vgDrd_vc_lte(VectorClock const   * const  vc1 ,   4211 __inline static Bool vgDrd_vc_lte(VectorClock const   * const  vc1 ,
4196                                   VectorClock const   * const  vc2 )   4212                                   VectorClock const   * const  vc2 )
4197 {   4213 {
4198   unsigned int i ;   4214   unsigned int i ;
4199   unsigned int j ;   4215   unsigned int j ;
4200     4216  
4201   {   4217   {
4202   j = 0U;   4218   j = 0U;
4203   i = 0U;   4219   i = 0U;
4204   while (i < (unsigned int )vc1->size) {   4220   while (i < (unsigned int )vc1->size) {
4205     while (1) {   4221     while (1) {
4206       if (j < (unsigned int )vc2->size) {   4222       if (j < (unsigned int )vc2->size) {
4207         if ((vc2->vc + j)->threadid < (vc1->vc + i)->threadid) {   4223         if ((vc2->vc + j)->threadid < (vc1->vc + i)->threadid) {
4208     4224  
4209         } else {   4225         } else {
4210           break;   4226           break;
4211         }   4227         }
4212       } else {   4228       } else {
4213         break;   4229         break;
4214       }   4230       }
4215       j ++;   4231       j ++;
4216     }   4232     }
4217     if (j >= (unsigned int )vc2->size) {   4233     if (j >= (unsigned int )vc2->size) {
4218       return ((Bool )0);   4234       return ((Bool )0);
4219     } else   4235     } else
4220     if ((vc2->vc + j)->threadid > (vc1->vc + i)->threadid) {   4236     if ((vc2->vc + j)->threadid > (vc1->vc + i)->threadid) {
4221       return ((Bool )0);   4237       return ((Bool )0);
4222     } else {   4238     } else {
4223     4239  
4224     }   4240     }
4225     if ((vc1->vc + i)->count > (vc2->vc + j)->count) {   4241     if ((vc1->vc + i)->count > (vc2->vc + j)->count) {
4226       return ((Bool )0);   4242       return ((Bool )0);
4227     } else {   4243     } else {
4228     4244  
4229     }   4245     }
4230     i ++;   4246     i ++;
4231   }   4247   }
4232   return ((Bool )1);   4248   return ((Bool )1);
4233 }   4249 }
4234 }   4250 }
4235 extern ExeContext *vgPlain_record_ExeContext(ThreadId tid , Word first_ip_delta ) ;   4251 extern ExeContext *vgPlain_record_ExeContext(ThreadId tid , Word first_ip_delta ) ;
4236 extern ExeContext *vgPlain_record_depth_1_ExeContext(ThreadId tid ) ;   4252 extern ExeContext *vgPlain_record_depth_1_ExeContext(ThreadId tid ) ;
4237 extern void vgPlain_apply_ExeContext(void (*action)(UInt n , Addr ip ) ,   4253 extern void vgPlain_apply_ExeContext(void (*action)(UInt n , Addr ip ) ,
4238                                      ExeContext *ec , UInt n_ips ) ;   4254                                      ExeContext *ec , UInt n_ips ) ;
4239 extern Bool vgPlain_eq_ExeContext(VgRes res , ExeContext *e1 , ExeContext *e2 ) ;   4255 extern Bool vgPlain_eq_ExeContext(VgRes res , ExeContext *e1 , ExeContext *e2 ) ;
4240 extern void vgPlain_pp_ExeContext(ExeContext *ec ) ;   4256 extern void vgPlain_pp_ExeContext(ExeContext *ec ) ;
4241 extern UInt vgPlain_get_ECU_from_ExeContext(ExeContext *e ) ;   4257 extern UInt vgPlain_get_ECU_from_ExeContext(ExeContext *e ) ;
4242 extern Int vgPlain_get_ExeContext_n_ips(ExeContext *e ) ;   4258 extern Int vgPlain_get_ExeContext_n_ips(ExeContext *e ) ;
4243 extern ExeContext *vgPlain_get_ExeContext_from_ECU(UInt uniq ) ;   4259 extern ExeContext *vgPlain_get_ExeContext_from_ECU(UInt uniq ) ;
4244 extern ExeContext *vgPlain_make_depth_1_ExeContext_from_Addr(Addr a ) ;   4260 extern ExeContext *vgPlain_make_depth_1_ExeContext_from_Addr(Addr a ) ;
4245 __inline static Bool vgPlain_is_plausible_ECU(UInt ecu )   4261 __inline static Bool vgPlain_is_plausible_ECU(UInt ecu )
4246 {   4262 {
4247   int tmp ;   4263   int tmp ;
4248     4264  
4249   {   4265   {
4250   if (ecu > 0U) {   4266   if (ecu > 0U) {
4251     if ((ecu & 3U) == 0U) {   4267     if ((ecu & 3U) == 0U) {
4252       tmp = 1;   4268       tmp = 1;
4253     } else {   4269     } else {
4254       tmp = 0;   4270       tmp = 0;
4255     }   4271     }
4256   } else {   4272   } else {
4257     tmp = 0;   4273     tmp = 0;
4258   }   4274   }
4259   return ((Bool )tmp);   4275   return ((Bool )tmp);
4260 }   4276 }
4261 }   4277 }
4262 extern ExeContext *vgPlain_make_ExeContext_from_StackTrace(Addr *ips ,   4278 extern ExeContext *vgPlain_make_ExeContext_from_StackTrace(Addr *ips ,
4263                                                            UInt n_ips ) ;   4279                                                            UInt n_ips ) ;
4264 extern UInt vgPlain_get_StackTrace(ThreadId tid , StackTrace ips , UInt n_ips ,   4280 extern UInt vgPlain_get_StackTrace(ThreadId tid , StackTrace ips , UInt n_ips ,
4265                                    StackTrace sps , StackTrace fps ,   4281                                    StackTrace sps , StackTrace fps ,
4266                                    Word first_ip_delta ) ;   4282                                    Word first_ip_delta ) ;
4267 extern void vgPlain_apply_StackTrace(void (*action)(UInt n , Addr ip ,   4283 extern void vgPlain_apply_StackTrace(void (*action)(UInt n , Addr ip ,
4268                                                     void *opaque ) ,   4284                                                     void *opaque ) ,
4269                                      void *opaque , StackTrace ips , UInt n_ips ) ;   4285                                      void *opaque , StackTrace ips , UInt n_ips ) ;
4270 extern void vgPlain_pp_StackTrace(StackTrace ips , UInt n_ips ) ;   4286 extern void vgPlain_pp_StackTrace(StackTrace ips , UInt n_ips ) ;
4271 extern void vgPlain_get_and_pp_StackTrace(ThreadId tid , UInt n_ips ) ;   4287 extern void vgPlain_get_and_pp_StackTrace(ThreadId tid , UInt n_ips ) ;
4272 Segment *vgDrd_g_sg_list  ;   4288 Segment *vgDrd_g_sg_list  ;
4273 Segment *vgDrd_sg_new(DrdThreadId const   creator , DrdThreadId const   created ) ;   4289 Segment *vgDrd_sg_new(DrdThreadId const   creator , DrdThreadId const   created ) ;
4274 __inline static int vgDrd_sg_get_refcnt(Segment const   * const  sg ) ;   4290 __inline static int vgDrd_sg_get_refcnt(Segment const   * const  sg ) ;
4275 Segment *vgDrd_sg_get(Segment * const  sg ) ;   4291 Segment *vgDrd_sg_get(Segment * const  sg ) ;
4276 void vgDrd_sg_put(Segment * const  sg ) ;   4292 void vgDrd_sg_put(Segment * const  sg ) ;
4277 __inline static struct bitmap *vgDrd_sg_bm(Segment * const  sg ) ;   4293 __inline static struct bitmap *vgDrd_sg_bm(Segment * const  sg ) ;
4278 void vgDrd_sg_merge(Segment * const  sg1 , Segment * const  sg2 ) ;   4294 void vgDrd_sg_merge(Segment * const  sg1 , Segment * const  sg2 ) ;
4279 void vgDrd_sg_print(Segment * const  sg ) ;   4295 void vgDrd_sg_print(Segment * const  sg ) ;
4280 Bool vgDrd_sg_get_trace(void) ;   4296 Bool vgDrd_sg_get_trace(void) ;
4281 void vgDrd_sg_set_trace(Bool const   trace_segment ) ;   4297 void vgDrd_sg_set_trace(Bool const   trace_segment ) ;
4282 ULong vgDrd_sg_get_segments_created_count(void) ;   4298 ULong vgDrd_sg_get_segments_created_count(void) ;
4283 ULong vgDrd_sg_get_segments_alive_count(void) ;   4299 ULong vgDrd_sg_get_segments_alive_count(void) ;
4284 ULong vgDrd_sg_get_max_segments_alive_count(void) ;   4300 ULong vgDrd_sg_get_max_segments_alive_count(void) ;
4285 ULong vgDrd_sg_get_segment_merge_count(void) ;   4301 ULong vgDrd_sg_get_segment_merge_count(void) ;
4286 __inline static int vgDrd_sg_get_refcnt(Segment const   * const  sg )   4302 __inline static int vgDrd_sg_get_refcnt(Segment const   * const  sg )
4287 {   4303 {
4288     4304  
4289     4305  
4290   {   4306   {
4291   return ((int )sg->refcnt);   4307   return ((int )sg->refcnt);
4292 }   4308 }
4293 }   4309 }
4294 __inline static struct bitmap *vgDrd_sg_bm(Segment * const  sg )   4310 __inline static struct bitmap *vgDrd_sg_bm(Segment * const  sg )
4295 {   4311 {
4296     4312  
4297     4313  
4298   {   4314   {
4299   return (& sg->bm);   4315   return (& sg->bm);
4300 }   4316 }
4301 }   4317 }
4302 extern ThreadId vgPlain_get_running_tid(void) ;   4318 extern ThreadId vgPlain_get_running_tid(void) ;
4303 DrdThreadId vgDrd_g_drd_running_tid ;   4319 DrdThreadId vgDrd_g_drd_running_tid ;
4304 ThreadInfo vgDrd_g_threadinfo[500]  ;   4320 ThreadInfo vgDrd_g_threadinfo[500]  ;
4305 struct bitmap *vgDrd_g_conflict_set  ;   4321 struct bitmap *vgDrd_g_conflict_set  ;
4306 void vgDrd_thread_trace_context_switches(Bool const   t ) ;   4322 void vgDrd_thread_trace_context_switches(Bool const   t ) ;
4307 void vgDrd_thread_trace_conflict_set(Bool const   t ) ;   4323 void vgDrd_thread_trace_conflict_set(Bool const   t ) ;
4308 void vgDrd_thread_trace_conflict_set_bm(Bool const   t ) ;   4324 void vgDrd_thread_trace_conflict_set_bm(Bool const   t ) ;
4309 Bool vgDrd_thread_get_trace_fork_join(void) ;   4325 Bool vgDrd_thread_get_trace_fork_join(void) ;
4310 void vgDrd_thread_set_trace_fork_join(Bool const   t ) ;   4326 void vgDrd_thread_set_trace_fork_join(Bool const   t ) ;
4311 void vgDrd_thread_set_segment_merging(Bool const   m ) ;   4327 void vgDrd_thread_set_segment_merging(Bool const   m ) ;
4312 int vgDrd_thread_get_segment_merge_interval(void) ;   4328 int vgDrd_thread_get_segment_merge_interval(void) ;
4313 void vgDrd_thread_set_segment_merge_interval(int const   i ) ;   4329 void vgDrd_thread_set_segment_merge_interval(int const   i ) ;
4314 void vgDrd_thread_set_join_list_vol(int const   jlv ) ;   4330 void vgDrd_thread_set_join_list_vol(int const   jlv ) ;
4315 void vgDrd_thread_init(void) ;   4331 void vgDrd_thread_init(void) ;
4316 DrdThreadId vgDrd_VgThreadIdToDrdThreadId(ThreadId const   tid ) ;   4332 DrdThreadId vgDrd_VgThreadIdToDrdThreadId(ThreadId const   tid ) ;
4317 extern DrdThreadId vgDrd_NewVgThreadIdToDrdThreadId(ThreadId const   tid ) ;   4333 extern DrdThreadId vgDrd_NewVgThreadIdToDrdThreadId(ThreadId const   tid ) ;
4318 DrdThreadId vgDrd_PtThreadIdToDrdThreadId(PThreadId const   tid ) ;   4334 DrdThreadId vgDrd_PtThreadIdToDrdThreadId(PThreadId const   tid ) ;
4319 ThreadId vgDrd_DrdThreadIdToVgThreadId(DrdThreadId const   tid ) ;   4335 ThreadId vgDrd_DrdThreadIdToVgThreadId(DrdThreadId const   tid ) ;
4320 DrdThreadId vgDrd_thread_pre_create(DrdThreadId const   creator ,   4336 DrdThreadId vgDrd_thread_pre_create(DrdThreadId const   creator ,
4321                                     ThreadId const   vg_created ) ;   4337                                     ThreadId const   vg_created ) ;
4322 DrdThreadId vgDrd_thread_post_create(ThreadId const   vg_created ) ;   4338 DrdThreadId vgDrd_thread_post_create(ThreadId const   vg_created ) ;
4323 void vgDrd_thread_post_join(DrdThreadId drd_joiner , DrdThreadId drd_joinee ) ;   4339 void vgDrd_thread_post_join(DrdThreadId drd_joiner , DrdThreadId drd_joinee ) ;
4324 void vgDrd_thread_delete(DrdThreadId const   tid , Bool const   detached ) ;   4340 void vgDrd_thread_delete(DrdThreadId const   tid , Bool const   detached ) ;
4325 void vgDrd_thread_finished(DrdThreadId const   tid ) ;   4341 void vgDrd_thread_finished(DrdThreadId const   tid ) ;
4326 void vgDrd_drd_thread_atfork_child(DrdThreadId const   tid ) ;   4342 void vgDrd_drd_thread_atfork_child(DrdThreadId const   tid ) ;
4327 void vgDrd_thread_pre_cancel(DrdThreadId const   tid ) ;   4343 void vgDrd_thread_pre_cancel(DrdThreadId const   tid ) ;
4328 void vgDrd_thread_set_stack_startup(DrdThreadId const   tid ,   4344 void vgDrd_thread_set_stack_startup(DrdThreadId const   tid ,
4329                                     Addr const   stack_startup ) ;   4345                                     Addr const   stack_startup ) ;
4330 Addr vgDrd_thread_get_stack_min(DrdThreadId const   tid ) ;   4346 Addr vgDrd_thread_get_stack_min(DrdThreadId const   tid ) ;
4331 Addr vgDrd_thread_get_stack_min_min(DrdThreadId const   tid ) ;   4347 Addr vgDrd_thread_get_stack_min_min(DrdThreadId const   tid ) ;
4332 Addr vgDrd_thread_get_stack_max(DrdThreadId const   tid ) ;   4348 Addr vgDrd_thread_get_stack_max(DrdThreadId const   tid ) ;
4333 SizeT vgDrd_thread_get_stack_size(DrdThreadId const   tid ) ;   4349 SizeT vgDrd_thread_get_stack_size(DrdThreadId const   tid ) ;
4334 Bool vgDrd_thread_get_on_alt_stack(DrdThreadId const   tid ) ;   4350 Bool vgDrd_thread_get_on_alt_stack(DrdThreadId const   tid ) ;
4335 void vgDrd_thread_set_on_alt_stack(DrdThreadId const   tid ,   4351 void vgDrd_thread_set_on_alt_stack(DrdThreadId const   tid ,
4336                                    Bool const   on_alt_stack ) ;   4352                                    Bool const   on_alt_stack ) ;
4337 Int vgDrd_thread_get_threads_on_alt_stack(void) ;   4353 Int vgDrd_thread_get_threads_on_alt_stack(void) ;
4338 void vgDrd_thread_set_pthreadid(DrdThreadId const   tid ,   4354 void vgDrd_thread_set_pthreadid(DrdThreadId const   tid ,
4339                                 PThreadId const   ptid ) ;   4355                                 PThreadId const   ptid ) ;
4340 Bool vgDrd_thread_get_joinable(DrdThreadId const   tid ) ;   4356 Bool vgDrd_thread_get_joinable(DrdThreadId const   tid ) ;
4341 void vgDrd_thread_set_joinable(DrdThreadId const   tid , Bool const   joinable ) ;   4357 void vgDrd_thread_set_joinable(DrdThreadId const   tid , Bool const   joinable ) ;
4342 void vgDrd_thread_entering_pthread_create(DrdThreadId const   tid ) ;   4358 void vgDrd_thread_entering_pthread_create(DrdThreadId const   tid ) ;
4343 void vgDrd_thread_left_pthread_create(DrdThreadId const   tid ) ;   4359 void vgDrd_thread_left_pthread_create(DrdThreadId const   tid ) ;
4344 char const   *vgDrd_thread_get_name(DrdThreadId const   tid ) ;   4360 char const   *vgDrd_thread_get_name(DrdThreadId const   tid ) ;
4345 void vgDrd_thread_set_name(DrdThreadId const   tid , char const   * const  name ) ;   4361 void vgDrd_thread_set_name(DrdThreadId const   tid , char const   * const  name ) ;
4346 void vgDrd_thread_set_vg_running_tid(ThreadId const   vg_tid ) ;   4362 void vgDrd_thread_set_vg_running_tid(ThreadId const   vg_tid ) ;
4347 void vgDrd_thread_set_running_tid(ThreadId const   vg_tid ,   4363 void vgDrd_thread_set_running_tid(ThreadId const   vg_tid ,
4348                                   DrdThreadId const   drd_tid ) ;   4364                                   DrdThreadId const   drd_tid ) ;
4349 int vgDrd_thread_enter_synchr(DrdThreadId const   tid ) ;   4365 int vgDrd_thread_enter_synchr(DrdThreadId const   tid ) ;
4350 int vgDrd_thread_leave_synchr(DrdThreadId const   tid ) ;   4366 int vgDrd_thread_leave_synchr(DrdThreadId const   tid ) ;
4351 int vgDrd_thread_get_synchr_nesting_count(DrdThreadId const   tid ) ;   4367 int vgDrd_thread_get_synchr_nesting_count(DrdThreadId const   tid ) ;
4352 void vgDrd_thread_new_segment(DrdThreadId const   tid ) ;   4368 void vgDrd_thread_new_segment(DrdThreadId const   tid ) ;
4353 VectorClock *vgDrd_thread_get_vc(DrdThreadId const   tid ) ;   4369 VectorClock *vgDrd_thread_get_vc(DrdThreadId const   tid ) ;
4354 void vgDrd_thread_get_latest_segment(Segment **sg , DrdThreadId const   tid ) ;   4370 void vgDrd_thread_get_latest_segment(Segment **sg , DrdThreadId const   tid ) ;
4355 void vgDrd_thread_combine_vc_join(DrdThreadId const   joiner ,   4371 void vgDrd_thread_combine_vc_join(DrdThreadId const   joiner ,
4356                                   DrdThreadId const   joinee ) ;   4372                                   DrdThreadId const   joinee ) ;
4357 void vgDrd_thread_new_segment_and_combine_vc(DrdThreadId tid ,   4373 void vgDrd_thread_new_segment_and_combine_vc(DrdThreadId tid ,
4358                                              Segment const   *sg ) ;   4374                                              Segment const   *sg ) ;
4359 void vgDrd_thread_update_conflict_set(DrdThreadId const   tid ,   4375 void vgDrd_thread_update_conflict_set(DrdThreadId const   tid ,
4360                                       VectorClock const   * const  old_vc ) ;   4376                                       VectorClock const   * const  old_vc ) ;
4361 void vgDrd_thread_stop_using_mem(Addr const   a1 , Addr const   a2 ) ;   4377 void vgDrd_thread_stop_using_mem(Addr const   a1 , Addr const   a2 ) ;
4362 void vgDrd_thread_set_record_loads(DrdThreadId const   tid ,   4378 void vgDrd_thread_set_record_loads(DrdThreadId const   tid ,
4363                                    Bool const   enabled ) ;   4379                                    Bool const   enabled ) ;
4364 void vgDrd_thread_set_record_stores(DrdThreadId const   tid ,   4380 void vgDrd_thread_set_record_stores(DrdThreadId const   tid ,
4365                                     Bool const   enabled ) ;   4381                                     Bool const   enabled ) ;
4366 void vgDrd_thread_print_all(void) ;   4382 void vgDrd_thread_print_all(void) ;
4367 extern void vgDrd_thread_report_races(DrdThreadId const   tid ) ;   4383 extern void vgDrd_thread_report_races(DrdThreadId const   tid ) ;
4368 extern void vgDrd_thread_report_races_segment(DrdThreadId const   tid ,   4384 extern void vgDrd_thread_report_races_segment(DrdThreadId const   tid ,
4369                                               Segment const   * const  p ) ;   4385                                               Segment const   * const  p ) ;
4370 extern void vgDrd_thread_report_all_races(void) ;   4386 extern void vgDrd_thread_report_all_races(void) ;
4371 void vgDrd_thread_report_conflicting_segments(DrdThreadId const   tid ,   4387 void vgDrd_thread_report_conflicting_segments(DrdThreadId const   tid ,
4372                                               Addr const   addr ,   4388                                               Addr const   addr ,
4373                                               SizeT const   size ,   4389                                               SizeT const   size ,
4374                                               BmAccessTypeT const   access_type ) ;   4390                                               BmAccessTypeT const   access_type ) ;
4375 ULong vgDrd_thread_get_context_switch_count(void) ;   4391 ULong vgDrd_thread_get_context_switch_count(void) ;
4376 extern ULong vgDrd_thread_get_report_races_count(void) ;   4392 extern ULong vgDrd_thread_get_report_races_count(void) ;
4377 ULong vgDrd_thread_get_discard_ordered_segments_count(void) ;   4393 ULong vgDrd_thread_get_discard_ordered_segments_count(void) ;
4378 ULong vgDrd_thread_get_compute_conflict_set_count(void) ;   4394 ULong vgDrd_thread_get_compute_conflict_set_count(void) ;
4379 ULong vgDrd_thread_get_update_conflict_set_count(void) ;   4395 ULong vgDrd_thread_get_update_conflict_set_count(void) ;
4380 ULong vgDrd_thread_get_update_conflict_set_new_sg_count(void) ;   4396 ULong vgDrd_thread_get_update_conflict_set_new_sg_count(void) ;
4381 ULong vgDrd_thread_get_update_conflict_set_sync_count(void) ;   4397 ULong vgDrd_thread_get_update_conflict_set_sync_count(void) ;
4382 ULong vgDrd_thread_get_update_conflict_set_join_count(void) ;   4398 ULong vgDrd_thread_get_update_conflict_set_join_count(void) ;
4383 ULong vgDrd_thread_get_conflict_set_bitmap_creation_count(void) ;   4399 ULong vgDrd_thread_get_conflict_set_bitmap_creation_count(void) ;
4384 ULong vgDrd_thread_get_conflict_set_bitmap2_creation_count(void) ;   4400 ULong vgDrd_thread_get_conflict_set_bitmap2_creation_count(void) ;
4385 __inline static Bool vgDrd_IsValidDrdThreadId(DrdThreadId const   tid )   4401 __inline static Bool vgDrd_IsValidDrdThreadId(DrdThreadId const   tid )
4386 {   4402 {
4387   int tmp ;   4403   int tmp ;
4388     4404  
4389   {   4405   {
4390   if (0 <= (int )tid) {   4406   if (0 <= (int )tid) {
4391     if (tid < 500U) {   4407     if (tid < 500U) {
4392       if (tid != 0U) {   4408       if (tid != 0U) {
4393         if (vgDrd_g_threadinfo[tid].valid) {   4409         if (vgDrd_g_threadinfo[tid].valid) {
4394           tmp = 1;   4410           tmp = 1;
4395         } else {   4411         } else {
4396           tmp = 0;   4412           tmp = 0;
4397         }   4413         }
4398       } else {   4414       } else {
4399         tmp = 0;   4415         tmp = 0;
4400       }   4416       }
4401     } else {   4417     } else {
4402       tmp = 0;   4418       tmp = 0;
4403     }   4419     }
4404   } else {   4420   } else {
4405     tmp = 0;   4421     tmp = 0;
4406   }   4422   }
4407   return ((Bool )tmp);   4423   return ((Bool )tmp);
4408 }   4424 }
4409 }   4425 }
4410 __inline static DrdThreadId vgDrd_thread_get_running_tid(void)   4426 __inline static DrdThreadId vgDrd_thread_get_running_tid(void)
4411 {   4427 {
4412     4428  
4413     4429  
4414   {   4430   {
4415   return (vgDrd_g_drd_running_tid);   4431   return (vgDrd_g_drd_running_tid);
4416 }   4432 }
4417 }   4433 }
4418 __inline static struct bitmap *vgDrd_thread_get_conflict_set(void)   4434 __inline static struct bitmap *vgDrd_thread_get_conflict_set(void)
4419 {   4435 {
4420     4436  
4421     4437  
4422   {   4438   {
4423   return (vgDrd_g_conflict_set);   4439   return (vgDrd_g_conflict_set);
4424 }   4440 }
4425 }   4441 }
4426 __inline static Bool vgDrd_running_thread_inside_pthread_create(void)   4442 __inline static Bool vgDrd_running_thread_inside_pthread_create(void)
4427 {   4443 {
4428     4444  
4429     4445  
4430   {   4446   {
4431   return ((Bool )(vgDrd_g_threadinfo[vgDrd_g_drd_running_tid].pthread_create_nesting_level > 0));   4447   return ((Bool )(vgDrd_g_threadinfo[vgDrd_g_drd_running_tid].pthread_create_nesting_level > 0));
4432 }   4448 }
4433 }   4449 }
4434 __inline static Bool vgDrd_running_thread_is_recording_loads(void)   4450 __inline static Bool vgDrd_running_thread_is_recording_loads(void)
4435 {   4451 {
4436   int tmp ;   4452   int tmp ;
4437     4453  
4438   {   4454   {
4439   if (vgDrd_g_threadinfo[vgDrd_g_drd_running_tid].synchr_nesting == 0) {   4455   if (vgDrd_g_threadinfo[vgDrd_g_drd_running_tid].synchr_nesting == 0) {
4440     if (vgDrd_g_threadinfo[vgDrd_g_drd_running_tid].is_recording_loads) {   4456     if (vgDrd_g_threadinfo[vgDrd_g_drd_running_tid].is_recording_loads) {
4441       tmp = 1;   4457       tmp = 1;
4442     } else {   4458     } else {
4443       tmp = 0;   4459       tmp = 0;
4444     }   4460     }
4445   } else {   4461   } else {
4446     tmp = 0;   4462     tmp = 0;
4447   }   4463   }
4448   return ((Bool )tmp);   4464   return ((Bool )tmp);
4449 }   4465 }
4450 }   4466 }
4451 __inline static Bool vgDrd_running_thread_is_recording_stores(void)   4467 __inline static Bool vgDrd_running_thread_is_recording_stores(void)
4452 {   4468 {
4453   int tmp ;   4469   int tmp ;
4454     4470  
4455   {   4471   {
4456   if (vgDrd_g_threadinfo[vgDrd_g_drd_running_tid].synchr_nesting == 0) {   4472   if (vgDrd_g_threadinfo[vgDrd_g_drd_running_tid].synchr_nesting == 0) {
4457     if (vgDrd_g_threadinfo[vgDrd_g_drd_running_tid].is_recording_stores) {   4473     if (vgDrd_g_threadinfo[vgDrd_g_drd_running_tid].is_recording_stores) {
4458       tmp = 1;   4474       tmp = 1;
4459     } else {   4475     } else {
4460       tmp = 0;   4476       tmp = 0;
4461     }   4477     }
4462   } else {   4478   } else {
4463     tmp = 0;   4479     tmp = 0;
4464   }   4480   }
4465   return ((Bool )tmp);   4481   return ((Bool )tmp);
4466 }   4482 }
4467 }   4483 }
4468 __inline static void vgDrd_thread_set_stack_min(DrdThreadId const   tid ,   4484 __inline static void vgDrd_thread_set_stack_min(DrdThreadId const   tid ,
4469                                                 Addr const   stack_min )   4485                                                 Addr const   stack_min )
4470 {   4486 {
4471   long tmp ;   4487   long tmp ;
4472     4488  
4473   {   4489   {
4474   vgDrd_g_threadinfo[tid].stack_min = (Addr )stack_min;   4490   vgDrd_g_threadinfo[tid].stack_min = (Addr )stack_min;
4475   tmp = __builtin_expect((long )(! (! (stack_min < (Addr const   )vgDrd_g_threadinfo[tid].stack_min_min))),   4491   tmp = __builtin_expect((long )(! (! (stack_min < (Addr const   )vgDrd_g_threadinfo[tid].stack_min_min))),
4476                          0L);   4492                          0L);
4477   if (tmp) {   4493   if (tmp) {
4478     vgDrd_g_threadinfo[tid].stack_min_min = (Addr )stack_min;   4494     vgDrd_g_threadinfo[tid].stack_min_min = (Addr )stack_min;
4479   } else {   4495   } else {
4480     4496  
4481   }   4497   }
4482   return;   4498   return;
4483 }   4499 }
4484 }   4500 }
4485 __inline static Bool vgDrd_thread_address_on_stack(Addr const   a )   4501 __inline static Bool vgDrd_thread_address_on_stack(Addr const   a )
4486 {   4502 {
4487   int tmp ;   4503   int tmp ;
4488     4504  
4489   {   4505   {
4490   if (vgDrd_g_threadinfo[vgDrd_g_drd_running_tid].stack_min <= (Addr )a) {   4506   if (vgDrd_g_threadinfo[vgDrd_g_drd_running_tid].stack_min <= (Addr )a) {
4491     if (a < (Addr const   )vgDrd_g_threadinfo[vgDrd_g_drd_running_tid].stack_max) {   4507     if (a < (Addr const   )vgDrd_g_threadinfo[vgDrd_g_drd_running_tid].stack_max) {
4492       tmp = 1;   4508       tmp = 1;
4493     } else {   4509     } else {
4494       tmp = 0;   4510       tmp = 0;
4495     }   4511     }
4496   } else {   4512   } else {
4497     tmp = 0;   4513     tmp = 0;
4498   }   4514   }
4499   return ((Bool )tmp);   4515   return ((Bool )tmp);
4500 }   4516 }
4501 }   4517 }
4502 __inline static Bool vgDrd_thread_address_on_any_stack(Addr const   a )   4518 __inline static Bool vgDrd_thread_address_on_any_stack(Addr const   a )
4503 {   4519 {
4504   int i ;   4520   int i ;
4505     4521  
4506   {   4522   {
4507   i = 1;   4523   i = 1;
4508   while (i < 500) {   4524   while (i < 500) {
4509     if (vgDrd_g_threadinfo[i].vg_thread_exists) {   4525     if (vgDrd_g_threadinfo[i].vg_thread_exists) {
4510       if (vgDrd_g_threadinfo[i].stack_min <= (Addr )a) {   4526       if (vgDrd_g_threadinfo[i].stack_min <= (Addr )a) {
4511         if (a < (Addr const   )vgDrd_g_threadinfo[i].stack_max) {   4527         if (a < (Addr const   )vgDrd_g_threadinfo[i].stack_max) {
4512           return ((Bool )1);   4528           return ((Bool )1);
4513         } else {   4529         } else {
4514     4530  
4515         }   4531         }
4516       } else {   4532       } else {
4517     4533  
4518       }   4534       }
4519     } else {   4535     } else {
4520     4536  
4521     }   4537     }
4522     i ++;   4538     i ++;
4523   }   4539   }
4524   return ((Bool )0);   4540   return ((Bool )0);
4525 }   4541 }
4526 }   4542 }
4527 __inline static Segment *vgDrd_thread_get_segment(DrdThreadId const   tid )   4543 __inline static Segment *vgDrd_thread_get_segment(DrdThreadId const   tid )
4528 {   4544 {
4529     4545  
4530     4546  
4531   {   4547   {
4532   return (vgDrd_g_threadinfo[tid].sg_last);   4548   return (vgDrd_g_threadinfo[tid].sg_last);
4533 }   4549 }
4534 }   4550 }
4535 __inline static Segment *vgDrd_running_thread_get_segment(void)   4551 __inline static Segment *vgDrd_running_thread_get_segment(void)
4536 {   4552 {
4537   Segment *tmp ;   4553   Segment *tmp ;
4538     4554  
4539   {   4555   {
4540   tmp = vgDrd_thread_get_segment((DrdThreadId const   )vgDrd_g_drd_running_tid);   4556   tmp = vgDrd_thread_get_segment((DrdThreadId const   )vgDrd_g_drd_running_tid);
4541   return (tmp);   4557   return (tmp);
4542 }   4558 }
4543 }   4559 }
4544 __inline static Bool bm_access_load_1_triggers_conflict(Addr const   a1 )   4560 __inline static Bool bm_access_load_1_triggers_conflict(Addr const   a1 )
4545 {   4561 {
4546   Segment *tmp ;   4562   Segment *tmp ;
4547   struct bitmap *tmp___0 ;   4563   struct bitmap *tmp___0 ;
4548   struct bitmap *tmp___1 ;   4564   struct bitmap *tmp___1 ;
4549   Bool tmp___2 ;   4565   Bool tmp___2 ;
4550     4566  
4551   {   4567   {
4552   tmp = vgDrd_running_thread_get_segment();   4568   tmp = vgDrd_running_thread_get_segment();
4553   tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);   4569   tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);
4554   vgDrd_bm_access_load_1((struct bitmap */* const  */)tmp___0, a1);   4570   vgDrd_bm_access_load_1((struct bitmap */* const  */)tmp___0, a1);
4555   tmp___1 = vgDrd_thread_get_conflict_set();   4571   tmp___1 = vgDrd_thread_get_conflict_set();
4556   tmp___2 = vgDrd_bm_load_1_has_conflict_with((struct bitmap */* const  */)tmp___1,   4572   tmp___2 = vgDrd_bm_load_1_has_conflict_with((struct bitmap */* const  */)tmp___1,
4557                                               a1);   4573                                               a1);
4558   return (tmp___2);   4574   return (tmp___2);
4559 }   4575 }
4560 }   4576 }
4561 __inline static Bool bm_access_load_2_triggers_conflict(Addr const   a1 )   4577 __inline static Bool bm_access_load_2_triggers_conflict(Addr const   a1 )
4562 {   4578 {
4563   Segment *tmp ;   4579   Segment *tmp ;
4564   struct bitmap *tmp___0 ;   4580   struct bitmap *tmp___0 ;
4565   struct bitmap *tmp___1 ;   4581   struct bitmap *tmp___1 ;
4566   Bool tmp___2 ;   4582   Bool tmp___2 ;
4567   Segment *tmp___3 ;   4583   Segment *tmp___3 ;
4568   struct bitmap *tmp___4 ;   4584   struct bitmap *tmp___4 ;
4569   struct bitmap *tmp___5 ;   4585   struct bitmap *tmp___5 ;
4570   Bool tmp___6 ;   4586   Bool tmp___6 ;
4571     4587  
4572   {   4588   {
4573   if ((a1 & 1UL) == 0UL) {   4589   if ((a1 & 1UL) == 0UL) {
4574     tmp = vgDrd_running_thread_get_segment();   4590     tmp = vgDrd_running_thread_get_segment();
4575     tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);   4591     tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);
4576     bm_access_aligned_load((struct bitmap */* const  */)tmp___0, a1,   4592     bm_access_aligned_load((struct bitmap */* const  */)tmp___0, a1,
4577                            (SizeT const   )2);   4593                            (SizeT const   )2);
4578     tmp___1 = vgDrd_thread_get_conflict_set();   4594     tmp___1 = vgDrd_thread_get_conflict_set();
4579     tmp___2 = bm_aligned_load_has_conflict_with((struct bitmap */* const  */)tmp___1,   4595     tmp___2 = bm_aligned_load_has_conflict_with((struct bitmap */* const  */)tmp___1,
4580                                                 a1, (SizeT const   )2);   4596                                                 a1, (SizeT const   )2);
4581     return (tmp___2);   4597     return (tmp___2);
4582   } else {   4598   } else {
4583     tmp___3 = vgDrd_running_thread_get_segment();   4599     tmp___3 = vgDrd_running_thread_get_segment();
4584     tmp___4 = vgDrd_sg_bm((Segment */* const  */)tmp___3);   4600     tmp___4 = vgDrd_sg_bm((Segment */* const  */)tmp___3);
4585     vgDrd_bm_access_range((struct bitmap */* const  */)tmp___4, a1, a1 + 2UL,   4601     vgDrd_bm_access_range((struct bitmap */* const  */)tmp___4, a1, a1 + 2UL,
4586                           (BmAccessTypeT const   )0);   4602                           (BmAccessTypeT const   )0);
4587     tmp___5 = vgDrd_thread_get_conflict_set();   4603     tmp___5 = vgDrd_thread_get_conflict_set();
4588     tmp___6 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___5,   4604     tmp___6 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___5,
4589                                          a1, a1 + 2UL, (BmAccessTypeT const   )0);   4605                                          a1, a1 + 2UL, (BmAccessTypeT const   )0);
4590     return (tmp___6);   4606     return (tmp___6);
4591   }   4607   }
4592 }   4608 }
4593 }   4609 }
4594 __inline static Bool bm_access_load_4_triggers_conflict(Addr const   a1 )   4610 __inline static Bool bm_access_load_4_triggers_conflict(Addr const   a1 )
4595 {   4611 {
4596   Segment *tmp ;   4612   Segment *tmp ;
4597   struct bitmap *tmp___0 ;   4613   struct bitmap *tmp___0 ;
4598   struct bitmap *tmp___1 ;   4614   struct bitmap *tmp___1 ;
4599   Bool tmp___2 ;   4615   Bool tmp___2 ;
4600   Segment *tmp___3 ;   4616   Segment *tmp___3 ;
4601   struct bitmap *tmp___4 ;   4617   struct bitmap *tmp___4 ;
4602   struct bitmap *tmp___5 ;   4618   struct bitmap *tmp___5 ;
4603   Bool tmp___6 ;   4619   Bool tmp___6 ;
4604     4620  
4605   {   4621   {
4606   if ((a1 & 3UL) == 0UL) {   4622   if ((a1 & 3UL) == 0UL) {
4607     tmp = vgDrd_running_thread_get_segment();   4623     tmp = vgDrd_running_thread_get_segment();
4608     tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);   4624     tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);
4609     bm_access_aligned_load((struct bitmap */* const  */)tmp___0, a1,   4625     bm_access_aligned_load((struct bitmap */* const  */)tmp___0, a1,
4610                            (SizeT const   )4);   4626                            (SizeT const   )4);
4611     tmp___1 = vgDrd_thread_get_conflict_set();   4627     tmp___1 = vgDrd_thread_get_conflict_set();
4612     tmp___2 = bm_aligned_load_has_conflict_with((struct bitmap */* const  */)tmp___1,   4628     tmp___2 = bm_aligned_load_has_conflict_with((struct bitmap */* const  */)tmp___1,
4613                                                 a1, (SizeT const   )4);   4629                                                 a1, (SizeT const   )4);
4614     return (tmp___2);   4630     return (tmp___2);
4615   } else {   4631   } else {
4616     tmp___3 = vgDrd_running_thread_get_segment();   4632     tmp___3 = vgDrd_running_thread_get_segment();
4617     tmp___4 = vgDrd_sg_bm((Segment */* const  */)tmp___3);   4633     tmp___4 = vgDrd_sg_bm((Segment */* const  */)tmp___3);
4618     vgDrd_bm_access_range((struct bitmap */* const  */)tmp___4, a1, a1 + 4UL,   4634     vgDrd_bm_access_range((struct bitmap */* const  */)tmp___4, a1, a1 + 4UL,
4619                           (BmAccessTypeT const   )0);   4635                           (BmAccessTypeT const   )0);
4620     tmp___5 = vgDrd_thread_get_conflict_set();   4636     tmp___5 = vgDrd_thread_get_conflict_set();
4621     tmp___6 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___5,   4637     tmp___6 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___5,
4622                                          a1, a1 + 4UL, (BmAccessTypeT const   )0);   4638                                          a1, a1 + 4UL, (BmAccessTypeT const   )0);
4623     return (tmp___6);   4639     return (tmp___6);
4624   }   4640   }
4625 }   4641 }
4626 }   4642 }
4627 __inline static Bool bm_access_load_8_triggers_conflict(Addr const   a1 )   4643 __inline static Bool bm_access_load_8_triggers_conflict(Addr const   a1 )
4628 {   4644 {
4629   Segment *tmp ;   4645   Segment *tmp ;
4630   struct bitmap *tmp___0 ;   4646   struct bitmap *tmp___0 ;
4631   struct bitmap *tmp___1 ;   4647   struct bitmap *tmp___1 ;
4632   Bool tmp___2 ;   4648   Bool tmp___2 ;
4633   Segment *tmp___3 ;   4649   Segment *tmp___3 ;
4634   struct bitmap *tmp___4 ;   4650   struct bitmap *tmp___4 ;
4635   Segment *tmp___5 ;   4651   Segment *tmp___5 ;
4636   struct bitmap *tmp___6 ;   4652   struct bitmap *tmp___6 ;
4637   struct bitmap *tmp___7 ;   4653   struct bitmap *tmp___7 ;
4638   Bool tmp___8 ;   4654   Bool tmp___8 ;
4639   Segment *tmp___9 ;   4655   Segment *tmp___9 ;
4640   struct bitmap *tmp___10 ;   4656   struct bitmap *tmp___10 ;
4641   struct bitmap *tmp___11 ;   4657   struct bitmap *tmp___11 ;
4642   Bool tmp___12 ;   4658   Bool tmp___12 ;
4643     4659  
4644   {   4660   {
4645   if ((a1 & 7UL) == 0UL) {   4661   if ((a1 & 7UL) == 0UL) {
4646     tmp = vgDrd_running_thread_get_segment();   4662     tmp = vgDrd_running_thread_get_segment();
4647     tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);   4663     tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);
4648     bm_access_aligned_load((struct bitmap */* const  */)tmp___0, a1,   4664     bm_access_aligned_load((struct bitmap */* const  */)tmp___0, a1,
4649                            (SizeT const   )8);   4665                            (SizeT const   )8);
4650     tmp___1 = vgDrd_thread_get_conflict_set();   4666     tmp___1 = vgDrd_thread_get_conflict_set();
4651     tmp___2 = bm_aligned_load_has_conflict_with((struct bitmap */* const  */)tmp___1,   4667     tmp___2 = bm_aligned_load_has_conflict_with((struct bitmap */* const  */)tmp___1,
4652                                                 a1, (SizeT const   )8);   4668                                                 a1, (SizeT const   )8);
4653     return (tmp___2);   4669     return (tmp___2);
4654   } else   4670   } else
4655   if ((a1 & 3UL) == 0UL) {   4671   if ((a1 & 3UL) == 0UL) {
4656     tmp___3 = vgDrd_running_thread_get_segment();   4672     tmp___3 = vgDrd_running_thread_get_segment();
4657     tmp___4 = vgDrd_sg_bm((Segment */* const  */)tmp___3);   4673     tmp___4 = vgDrd_sg_bm((Segment */* const  */)tmp___3);
4658     bm_access_aligned_load((struct bitmap */* const  */)tmp___4, a1,   4674     bm_access_aligned_load((struct bitmap */* const  */)tmp___4, a1,
4659                            (SizeT const   )4);   4675                            (SizeT const   )4);
4660     tmp___5 = vgDrd_running_thread_get_segment();   4676     tmp___5 = vgDrd_running_thread_get_segment();
4661     tmp___6 = vgDrd_sg_bm((Segment */* const  */)tmp___5);   4677     tmp___6 = vgDrd_sg_bm((Segment */* const  */)tmp___5);
4662     bm_access_aligned_load((struct bitmap */* const  */)tmp___6, a1 + 4UL,   4678     bm_access_aligned_load((struct bitmap */* const  */)tmp___6, a1 + 4UL,
4663                            (SizeT const   )4);   4679                            (SizeT const   )4);
4664     tmp___7 = vgDrd_thread_get_conflict_set();   4680     tmp___7 = vgDrd_thread_get_conflict_set();
4665     tmp___8 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___7,   4681     tmp___8 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___7,
4666                                          a1, a1 + 8UL, (BmAccessTypeT const   )0);   4682                                          a1, a1 + 8UL, (BmAccessTypeT const   )0);
4667     return (tmp___8);   4683     return (tmp___8);
4668   } else {   4684   } else {
4669     tmp___9 = vgDrd_running_thread_get_segment();   4685     tmp___9 = vgDrd_running_thread_get_segment();
4670     tmp___10 = vgDrd_sg_bm((Segment */* const  */)tmp___9);   4686     tmp___10 = vgDrd_sg_bm((Segment */* const  */)tmp___9);
4671     vgDrd_bm_access_range((struct bitmap */* const  */)tmp___10, a1, a1 + 8UL,   4687     vgDrd_bm_access_range((struct bitmap */* const  */)tmp___10, a1, a1 + 8UL,
4672                           (BmAccessTypeT const   )0);   4688                           (BmAccessTypeT const   )0);
4673     tmp___11 = vgDrd_thread_get_conflict_set();   4689     tmp___11 = vgDrd_thread_get_conflict_set();
4674     tmp___12 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___11,   4690     tmp___12 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___11,
4675                                           a1, a1 + 8UL,   4691                                           a1, a1 + 8UL,
4676                                           (BmAccessTypeT const   )0);   4692                                           (BmAccessTypeT const   )0);
4677     return (tmp___12);   4693     return (tmp___12);
4678   }   4694   }
4679 }   4695 }
4680 }   4696 }
4681 __inline static Bool bm_access_load_triggers_conflict(Addr const   a1 ,   4697 __inline static Bool bm_access_load_triggers_conflict(Addr const   a1 ,
4682                                                       Addr const   a2 )   4698                                                       Addr const   a2 )
4683 {   4699 {
4684   Segment *tmp ;   4700   Segment *tmp ;
4685   struct bitmap *tmp___0 ;   4701   struct bitmap *tmp___0 ;
4686   struct bitmap *tmp___1 ;   4702   struct bitmap *tmp___1 ;
4687   Bool tmp___2 ;   4703   Bool tmp___2 ;
4688     4704  
4689   {   4705   {
4690   tmp = vgDrd_running_thread_get_segment();   4706   tmp = vgDrd_running_thread_get_segment();
4691   tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);   4707   tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);
4692   vgDrd_bm_access_range_load((struct bitmap */* const  */)tmp___0, a1, a2);   4708   vgDrd_bm_access_range_load((struct bitmap */* const  */)tmp___0, a1, a2);
4693   tmp___1 = vgDrd_thread_get_conflict_set();   4709   tmp___1 = vgDrd_thread_get_conflict_set();
4694   tmp___2 = vgDrd_bm_load_has_conflict_with((struct bitmap */* const  */)tmp___1,   4710   tmp___2 = vgDrd_bm_load_has_conflict_with((struct bitmap */* const  */)tmp___1,
4695                                             a1, a2);   4711                                             a1, a2);
4696   return (tmp___2);   4712   return (tmp___2);
4697 }   4713 }
4698 }   4714 }
4699 __inline static Bool bm_access_store_1_triggers_conflict(Addr const   a1 )   4715 __inline static Bool bm_access_store_1_triggers_conflict(Addr const   a1 )
4700 {   4716 {
4701   Segment *tmp ;   4717   Segment *tmp ;
4702   struct bitmap *tmp___0 ;   4718   struct bitmap *tmp___0 ;
4703   struct bitmap *tmp___1 ;   4719   struct bitmap *tmp___1 ;
4704   Bool tmp___2 ;   4720   Bool tmp___2 ;
4705     4721  
4706   {   4722   {
4707   tmp = vgDrd_running_thread_get_segment();   4723   tmp = vgDrd_running_thread_get_segment();
4708   tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);   4724   tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);
4709   vgDrd_bm_access_store_1((struct bitmap */* const  */)tmp___0, a1);   4725   vgDrd_bm_access_store_1((struct bitmap */* const  */)tmp___0, a1);
4710   tmp___1 = vgDrd_thread_get_conflict_set();   4726   tmp___1 = vgDrd_thread_get_conflict_set();
4711   tmp___2 = vgDrd_bm_store_1_has_conflict_with((struct bitmap */* const  */)tmp___1,   4727   tmp___2 = vgDrd_bm_store_1_has_conflict_with((struct bitmap */* const  */)tmp___1,
4712                                                a1);   4728                                                a1);
4713   return (tmp___2);   4729   return (tmp___2);
4714 }   4730 }
4715 }   4731 }
4716 __inline static Bool bm_access_store_2_triggers_conflict(Addr const   a1 )   4732 __inline static Bool bm_access_store_2_triggers_conflict(Addr const   a1 )
4717 {   4733 {
4718   Segment *tmp ;   4734   Segment *tmp ;
4719   struct bitmap *tmp___0 ;   4735   struct bitmap *tmp___0 ;
4720   struct bitmap *tmp___1 ;   4736   struct bitmap *tmp___1 ;
4721   Bool tmp___2 ;   4737   Bool tmp___2 ;
4722   Segment *tmp___3 ;   4738   Segment *tmp___3 ;
4723   struct bitmap *tmp___4 ;   4739   struct bitmap *tmp___4 ;
4724   struct bitmap *tmp___5 ;   4740   struct bitmap *tmp___5 ;
4725   Bool tmp___6 ;   4741   Bool tmp___6 ;
4726     4742  
4727   {   4743   {
4728   if ((a1 & 1UL) == 0UL) {   4744   if ((a1 & 1UL) == 0UL) {
4729     tmp = vgDrd_running_thread_get_segment();   4745     tmp = vgDrd_running_thread_get_segment();
4730     tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);   4746     tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);
4731     bm_access_aligned_store((struct bitmap */* const  */)tmp___0, a1,   4747     bm_access_aligned_store((struct bitmap */* const  */)tmp___0, a1,
4732                             (SizeT const   )2);   4748                             (SizeT const   )2);
4733     tmp___1 = vgDrd_thread_get_conflict_set();   4749     tmp___1 = vgDrd_thread_get_conflict_set();
4734     tmp___2 = bm_aligned_store_has_conflict_with((struct bitmap */* const  */)tmp___1,   4750     tmp___2 = bm_aligned_store_has_conflict_with((struct bitmap */* const  */)tmp___1,
4735                                                  a1, (SizeT const   )2);   4751                                                  a1, (SizeT const   )2);
4736     return (tmp___2);   4752     return (tmp___2);
4737   } else {   4753   } else {
4738     tmp___3 = vgDrd_running_thread_get_segment();   4754     tmp___3 = vgDrd_running_thread_get_segment();
4739     tmp___4 = vgDrd_sg_bm((Segment */* const  */)tmp___3);   4755     tmp___4 = vgDrd_sg_bm((Segment */* const  */)tmp___3);
4740     vgDrd_bm_access_range((struct bitmap */* const  */)tmp___4, a1, a1 + 2UL,   4756     vgDrd_bm_access_range((struct bitmap */* const  */)tmp___4, a1, a1 + 2UL,
4741                           (BmAccessTypeT const   )1);   4757                           (BmAccessTypeT const   )1);
4742     tmp___5 = vgDrd_thread_get_conflict_set();   4758     tmp___5 = vgDrd_thread_get_conflict_set();
4743     tmp___6 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___5,   4759     tmp___6 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___5,
4744                                          a1, a1 + 2UL, (BmAccessTypeT const   )1);   4760                                          a1, a1 + 2UL, (BmAccessTypeT const   )1);
4745     return (tmp___6);   4761     return (tmp___6);
4746   }   4762   }
4747 }   4763 }
4748 }   4764 }
4749 __inline static Bool bm_access_store_4_triggers_conflict(Addr const   a1 )   4765 __inline static Bool bm_access_store_4_triggers_conflict(Addr const   a1 )
4750 {   4766 {
4751   Segment *tmp ;   4767   Segment *tmp ;
4752   struct bitmap *tmp___0 ;   4768   struct bitmap *tmp___0 ;
4753   struct bitmap *tmp___1 ;   4769   struct bitmap *tmp___1 ;
4754   Bool tmp___2 ;   4770   Bool tmp___2 ;
4755   Segment *tmp___3 ;   4771   Segment *tmp___3 ;
4756   struct bitmap *tmp___4 ;   4772   struct bitmap *tmp___4 ;
4757   struct bitmap *tmp___5 ;   4773   struct bitmap *tmp___5 ;
4758   Bool tmp___6 ;   4774   Bool tmp___6 ;
4759     4775  
4760   {   4776   {
4761   if ((a1 & 3UL) == 0UL) {   4777   if ((a1 & 3UL) == 0UL) {
4762     tmp = vgDrd_running_thread_get_segment();   4778     tmp = vgDrd_running_thread_get_segment();
4763     tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);   4779     tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);
4764     bm_access_aligned_store((struct bitmap */* const  */)tmp___0, a1,   4780     bm_access_aligned_store((struct bitmap */* const  */)tmp___0, a1,
4765                             (SizeT const   )4);   4781                             (SizeT const   )4);
4766     tmp___1 = vgDrd_thread_get_conflict_set();   4782     tmp___1 = vgDrd_thread_get_conflict_set();
4767     tmp___2 = bm_aligned_store_has_conflict_with((struct bitmap */* const  */)tmp___1,   4783     tmp___2 = bm_aligned_store_has_conflict_with((struct bitmap */* const  */)tmp___1,
4768                                                  a1, (SizeT const   )4);   4784                                                  a1, (SizeT const   )4);
4769     return (tmp___2);   4785     return (tmp___2);
4770   } else {   4786   } else {
4771     tmp___3 = vgDrd_running_thread_get_segment();   4787     tmp___3 = vgDrd_running_thread_get_segment();
4772     tmp___4 = vgDrd_sg_bm((Segment */* const  */)tmp___3);   4788     tmp___4 = vgDrd_sg_bm((Segment */* const  */)tmp___3);
4773     vgDrd_bm_access_range((struct bitmap */* const  */)tmp___4, a1, a1 + 4UL,   4789     vgDrd_bm_access_range((struct bitmap */* const  */)tmp___4, a1, a1 + 4UL,
4774                           (BmAccessTypeT const   )1);   4790                           (BmAccessTypeT const   )1);
4775     tmp___5 = vgDrd_thread_get_conflict_set();   4791     tmp___5 = vgDrd_thread_get_conflict_set();
4776     tmp___6 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___5,   4792     tmp___6 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___5,
4777                                          a1, a1 + 4UL, (BmAccessTypeT const   )1);   4793                                          a1, a1 + 4UL, (BmAccessTypeT const   )1);
4778     return (tmp___6);   4794     return (tmp___6);
4779   }   4795   }
4780 }   4796 }
4781 }   4797 }
4782 __inline static Bool bm_access_store_8_triggers_conflict(Addr const   a1 )   4798 __inline static Bool bm_access_store_8_triggers_conflict(Addr const   a1 )
4783 {   4799 {
4784   Segment *tmp ;   4800   Segment *tmp ;
4785   struct bitmap *tmp___0 ;   4801   struct bitmap *tmp___0 ;
4786   struct bitmap *tmp___1 ;   4802   struct bitmap *tmp___1 ;
4787   Bool tmp___2 ;   4803   Bool tmp___2 ;
4788   Segment *tmp___3 ;   4804   Segment *tmp___3 ;
4789   struct bitmap *tmp___4 ;   4805   struct bitmap *tmp___4 ;
4790   Segment *tmp___5 ;   4806   Segment *tmp___5 ;
4791   struct bitmap *tmp___6 ;   4807   struct bitmap *tmp___6 ;
4792   struct bitmap *tmp___7 ;   4808   struct bitmap *tmp___7 ;
4793   Bool tmp___8 ;   4809   Bool tmp___8 ;
4794   Segment *tmp___9 ;   4810   Segment *tmp___9 ;
4795   struct bitmap *tmp___10 ;   4811   struct bitmap *tmp___10 ;
4796   struct bitmap *tmp___11 ;   4812   struct bitmap *tmp___11 ;
4797   Bool tmp___12 ;   4813   Bool tmp___12 ;
4798     4814  
4799   {   4815   {
4800   if ((a1 & 7UL) == 0UL) {   4816   if ((a1 & 7UL) == 0UL) {
4801     tmp = vgDrd_running_thread_get_segment();   4817     tmp = vgDrd_running_thread_get_segment();
4802     tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);   4818     tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);
4803     bm_access_aligned_store((struct bitmap */* const  */)tmp___0, a1,   4819     bm_access_aligned_store((struct bitmap */* const  */)tmp___0, a1,
4804                             (SizeT const   )8);   4820                             (SizeT const   )8);
4805     tmp___1 = vgDrd_thread_get_conflict_set();   4821     tmp___1 = vgDrd_thread_get_conflict_set();
4806     tmp___2 = bm_aligned_store_has_conflict_with((struct bitmap */* const  */)tmp___1,   4822     tmp___2 = bm_aligned_store_has_conflict_with((struct bitmap */* const  */)tmp___1,
4807                                                  a1, (SizeT const   )8);   4823                                                  a1, (SizeT const   )8);
4808     return (tmp___2);   4824     return (tmp___2);
4809   } else   4825   } else
4810   if ((a1 & 3UL) == 0UL) {   4826   if ((a1 & 3UL) == 0UL) {
4811     tmp___3 = vgDrd_running_thread_get_segment();   4827     tmp___3 = vgDrd_running_thread_get_segment();
4812     tmp___4 = vgDrd_sg_bm((Segment */* const  */)tmp___3);   4828     tmp___4 = vgDrd_sg_bm((Segment */* const  */)tmp___3);
4813     bm_access_aligned_store((struct bitmap */* const  */)tmp___4, a1,   4829     bm_access_aligned_store((struct bitmap */* const  */)tmp___4, a1,
4814                             (SizeT const   )4);   4830                             (SizeT const   )4);
4815     tmp___5 = vgDrd_running_thread_get_segment();   4831     tmp___5 = vgDrd_running_thread_get_segment();
4816     tmp___6 = vgDrd_sg_bm((Segment */* const  */)tmp___5);   4832     tmp___6 = vgDrd_sg_bm((Segment */* const  */)tmp___5);
4817     bm_access_aligned_store((struct bitmap */* const  */)tmp___6, a1 + 4UL,   4833     bm_access_aligned_store((struct bitmap */* const  */)tmp___6, a1 + 4UL,
4818                             (SizeT const   )4);   4834                             (SizeT const   )4);
4819     tmp___7 = vgDrd_thread_get_conflict_set();   4835     tmp___7 = vgDrd_thread_get_conflict_set();
4820     tmp___8 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___7,   4836     tmp___8 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___7,
4821                                          a1, a1 + 8UL, (BmAccessTypeT const   )1);   4837                                          a1, a1 + 8UL, (BmAccessTypeT const   )1);
4822     return (tmp___8);   4838     return (tmp___8);
4823   } else {   4839   } else {
4824     tmp___9 = vgDrd_running_thread_get_segment();   4840     tmp___9 = vgDrd_running_thread_get_segment();
4825     tmp___10 = vgDrd_sg_bm((Segment */* const  */)tmp___9);   4841     tmp___10 = vgDrd_sg_bm((Segment */* const  */)tmp___9);
4826     vgDrd_bm_access_range((struct bitmap */* const  */)tmp___10, a1, a1 + 8UL,   4842     vgDrd_bm_access_range((struct bitmap */* const  */)tmp___10, a1, a1 + 8UL,
4827                           (BmAccessTypeT const   )1);   4843                           (BmAccessTypeT const   )1);
4828     tmp___11 = vgDrd_thread_get_conflict_set();   4844     tmp___11 = vgDrd_thread_get_conflict_set();
4829     tmp___12 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___11,   4845     tmp___12 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___11,
4830                                           a1, a1 + 8UL,   4846                                           a1, a1 + 8UL,
4831                                           (BmAccessTypeT const   )1);   4847                                           (BmAccessTypeT const   )1);
4832     return (tmp___12);   4848     return (tmp___12);
4833   }   4849   }
4834 }   4850 }
4835 }   4851 }
4836 __inline static Bool bm_access_store_triggers_conflict(Addr const   a1 ,   4852 __inline static Bool bm_access_store_triggers_conflict(Addr const   a1 ,
4837                                                        Addr const   a2 )   4853                                                        Addr const   a2 )
4838 {   4854 {
4839   Segment *tmp ;   4855   Segment *tmp ;
4840   struct bitmap *tmp___0 ;   4856   struct bitmap *tmp___0 ;
4841   struct bitmap *tmp___1 ;   4857   struct bitmap *tmp___1 ;
4842   Bool tmp___2 ;   4858   Bool tmp___2 ;
4843     4859  
4844   {   4860   {
4845   tmp = vgDrd_running_thread_get_segment();   4861   tmp = vgDrd_running_thread_get_segment();
4846   tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);   4862   tmp___0 = vgDrd_sg_bm((Segment */* const  */)tmp);
4847   vgDrd_bm_access_range_store((struct bitmap */* const  */)tmp___0, a1, a2);   4863   vgDrd_bm_access_range_store((struct bitmap */* const  */)tmp___0, a1, a2);
4848   tmp___1 = vgDrd_thread_get_conflict_set();   4864   tmp___1 = vgDrd_thread_get_conflict_set();
4849   tmp___2 = vgDrd_bm_store_has_conflict_with((struct bitmap */* const  */)tmp___1,   4865   tmp___2 = vgDrd_bm_store_has_conflict_with((struct bitmap */* const  */)tmp___1,
4850                                              a1, a2);   4866                                              a1, a2);
4851   return (tmp___2);   4867   return (tmp___2);
4852 }   4868 }
4853 }   4869 }
4854 extern Bool vgPlain_get_filename(Addr a , Char *filename , Int n_filename ) ;   4870 extern Bool vgPlain_get_filename(Addr a , Char *filename , Int n_filename ) ;
4855 extern Bool vgPlain_get_fnname(Addr a , Char *fnname , Int n_fnname ) ;   4871 extern Bool vgPlain_get_fnname(Addr a , Char *fnname , Int n_fnname ) ;
4856 extern Bool vgPlain_get_linenum(Addr a , UInt *linenum ) ;   4872 extern Bool vgPlain_get_linenum(Addr a , UInt *linenum ) ;
4857 extern Bool vgPlain_get_fnname_w_offset(Addr a , Char *fnname , Int n_fnname ) ;   4873 extern Bool vgPlain_get_fnname_w_offset(Addr a , Char *fnname , Int n_fnname ) ;
4858 extern Bool vgPlain_get_filename_linenum(Addr a , Char *filename ,   4874 extern Bool vgPlain_get_filename_linenum(Addr a , Char *filename ,
4859                                          Int n_filename , Char *dirname ,   4875                                          Int n_filename , Char *dirname ,
4860                                          Int n_dirname ,   4876                                          Int n_dirname ,
4861                                          Bool *dirname_available ,   4877                                          Bool *dirname_available ,
4862                                          UInt *linenum ) ;   4878                                          UInt *linenum ) ;
4863 extern Bool vgPlain_get_fnname_if_entry(Addr a , Char *fnname , Int n_fnname ) ;   4879 extern Bool vgPlain_get_fnname_if_entry(Addr a , Char *fnname , Int n_fnname ) ;
4864 extern Vg_FnNameKind vgPlain_get_fnname_kind(Char *name ) ;   4880 extern Vg_FnNameKind vgPlain_get_fnname_kind(Char *name ) ;
4865 extern Vg_FnNameKind vgPlain_get_fnname_kind_from_IP(Addr ip ) ;   4881 extern Vg_FnNameKind vgPlain_get_fnname_kind_from_IP(Addr ip ) ;
4866 extern Bool vgPlain_get_datasym_and_offset(Addr data_addr , Char *dname ,   4882 extern Bool vgPlain_get_datasym_and_offset(Addr data_addr , Char *dname ,
4867                                            Int n_dname , PtrdiffT *offset ) ;   4883                                            Int n_dname , PtrdiffT *offset ) ;
4868 extern Bool vgPlain_get_data_description(void *dname1v , void *dname2v ,   4884 extern Bool vgPlain_get_data_description(void *dname1v , void *dname2v ,
4869                                          Addr data_addr ) ;   4885                                          Addr data_addr ) ;
4870 extern Bool vgPlain_get_objname(Addr a , Char *objname , Int n_objname ) ;   4886 extern Bool vgPlain_get_objname(Addr a , Char *objname , Int n_objname ) ;
4871 extern Char *vgPlain_describe_IP(Addr eip , Char *buf , Int n_buf ) ;   4887 extern Char *vgPlain_describe_IP(Addr eip , Char *buf , Int n_buf ) ;
4872 extern void *vgPlain_di_get_stack_blocks_at_ip(Addr ip , Bool arrays_only ) ;   4888 extern void *vgPlain_di_get_stack_blocks_at_ip(Addr ip , Bool arrays_only ) ;
4873 extern void *vgPlain_di_get_global_blocks_from_dihandle(ULong di_handle ,   4889 extern void *vgPlain_di_get_global_blocks_from_dihandle(ULong di_handle ,
4874                                                         Bool arrays_only ) ;   4890                                                         Bool arrays_only ) ;
4875 extern DebugInfo *vgPlain_find_DebugInfo(Addr a ) ;   4891 extern DebugInfo *vgPlain_find_DebugInfo(Addr a ) ;
4876 extern Addr vgPlain_DebugInfo_get_text_avma(DebugInfo const   *di ) ;   4892 extern Addr vgPlain_DebugInfo_get_text_avma(DebugInfo const   *di ) ;
4877 extern SizeT vgPlain_DebugInfo_get_text_size(DebugInfo const   *di ) ;   4893 extern SizeT vgPlain_DebugInfo_get_text_size(DebugInfo const   *di ) ;
4878 extern Addr vgPlain_DebugInfo_get_plt_avma(DebugInfo const   *di ) ;   4894 extern Addr vgPlain_DebugInfo_get_plt_avma(DebugInfo const   *di ) ;
4879 extern SizeT vgPlain_DebugInfo_get_plt_size(DebugInfo const   *di ) ;   4895 extern SizeT vgPlain_DebugInfo_get_plt_size(DebugInfo const   *di ) ;
4880 extern Addr vgPlain_DebugInfo_get_gotplt_avma(DebugInfo const   *di ) ;   4896 extern Addr vgPlain_DebugInfo_get_gotplt_avma(DebugInfo const   *di ) ;
4881 extern SizeT vgPlain_DebugInfo_get_gotplt_size(DebugInfo const   *di ) ;   4897 extern SizeT vgPlain_DebugInfo_get_gotplt_size(DebugInfo const   *di ) ;
4882 extern UChar const   *vgPlain_DebugInfo_get_soname(DebugInfo const   *di ) ;   4898 extern UChar const   *vgPlain_DebugInfo_get_soname(DebugInfo const   *di ) ;
4883 extern UChar const   *vgPlain_DebugInfo_get_filename(DebugInfo const   *di ) ;   4899 extern UChar const   *vgPlain_DebugInfo_get_filename(DebugInfo const   *di ) ;
4884 extern PtrdiffT vgPlain_DebugInfo_get_text_bias(DebugInfo const   *di ) ;   4900 extern PtrdiffT vgPlain_DebugInfo_get_text_bias(DebugInfo const   *di ) ;
4885 extern DebugInfo const   *vgPlain_next_DebugInfo(DebugInfo const   *di ) ;   4901 extern DebugInfo const   *vgPlain_next_DebugInfo(DebugInfo const   *di ) ;
4886 extern Int vgPlain_DebugInfo_syms_howmany(DebugInfo const   *di ) ;   4902 extern Int vgPlain_DebugInfo_syms_howmany(DebugInfo const   *di ) ;
4887 extern void vgPlain_DebugInfo_syms_getidx(DebugInfo const   *di , Int idx ,   4903 extern void vgPlain_DebugInfo_syms_getidx(DebugInfo const   *di , Int idx ,
4888                                           Addr *avma , Addr *tocptr ,   4904                                           Addr *avma , Addr *tocptr ,
4889                                           UInt *size , UChar **pri_name ,   4905                                           UInt *size , UChar **pri_name ,
4890                                           UChar ***sec_names , Bool *isText ,   4906                                           UChar ***sec_names , Bool *isText ,
4891                                           Bool *isIFunc ) ;   4907                                           Bool *isIFunc ) ;
4892 extern HChar const   *vgPlain_pp_SectKind(VgSectKind kind ) ;   4908 extern HChar const   *vgPlain_pp_SectKind(VgSectKind kind ) ;
4893 extern VgSectKind vgPlain_DebugInfo_sect_kind(UChar *name , SizeT n_name ,   4909 extern VgSectKind vgPlain_DebugInfo_sect_kind(UChar *name , SizeT n_name ,
4894                                               Addr a ) ;   4910                                               Addr a ) ;
4895 extern ExeContext *vgPlain_get_error_where(Error *err ) ;   4911 extern ExeContext *vgPlain_get_error_where(Error *err ) ;
4896 extern ErrorKind vgPlain_get_error_kind(Error *err ) ;   4912 extern ErrorKind vgPlain_get_error_kind(Error *err ) ;
4897 extern Addr vgPlain_get_error_address(Error *err ) ;   4913 extern Addr vgPlain_get_error_address(Error *err ) ;
4898 extern Char *vgPlain_get_error_string(Error *err ) ;   4914 extern Char *vgPlain_get_error_string(Error *err ) ;
4899 extern void *vgPlain_get_error_extra(Error *err ) ;   4915 extern void *vgPlain_get_error_extra(Error *err ) ;
4900 extern void vgPlain_maybe_record_error(ThreadId tid , ErrorKind ekind , Addr a ,   4916 extern void vgPlain_maybe_record_error(ThreadId tid , ErrorKind ekind , Addr a ,
4901                                        Char *s , void *extra ) ;   4917                                        Char *s , void *extra ) ;
4902 extern Bool vgPlain_unique_error(ThreadId tid , ErrorKind ekind , Addr a ,   4918 extern Bool vgPlain_unique_error(ThreadId tid , ErrorKind ekind , Addr a ,
4903                                  Char *s , void *extra , ExeContext *where ,   4919                                  Char *s , void *extra , ExeContext *where ,
4904                                  Bool print_error , Bool allow_GDB_attach ,   4920                                  Bool print_error , Bool allow_GDB_attach ,
4905                                  Bool count_error ) ;   4921                                  Bool count_error ) ;
4906 extern Bool vgPlain_get_line(Int fd , Char **bufpp , SizeT *nBufp , Int *lineno ) ;   4922 extern Bool vgPlain_get_line(Int fd , Char **bufpp , SizeT *nBufp , Int *lineno ) ;
4907 extern SuppKind vgPlain_get_supp_kind(Supp *su ) ;   4923 extern SuppKind vgPlain_get_supp_kind(Supp *su ) ;
4908 extern Char *vgPlain_get_supp_string(Supp *su ) ;   4924 extern Char *vgPlain_get_supp_string(Supp *su ) ;
4909 extern void *vgPlain_get_supp_extra(Supp *su ) ;   4925 extern void *vgPlain_get_supp_extra(Supp *su ) ;
4910 extern void vgPlain_set_supp_kind(Supp *su , SuppKind suppkind ) ;   4926 extern void vgPlain_set_supp_kind(Supp *su , SuppKind suppkind ) ;
4911 extern void vgPlain_set_supp_string(Supp *su , Char *string ) ;   4927 extern void vgPlain_set_supp_string(Supp *su , Char *string ) ;
4912 extern void vgPlain_set_supp_extra(Supp *su , void *extra ) ;   4928 extern void vgPlain_set_supp_extra(Supp *su , void *extra ) ;
4913 extern void vgDrd_set_show_conflicting_segments(Bool const   scs ) ;   4929 extern void vgDrd_set_show_conflicting_segments(Bool const   scs ) ;
4914 extern void vgDrd_register_error_handlers(void) ;   4930 extern void vgDrd_register_error_handlers(void) ;
4915 extern void ( /* format attribute */  vgDrd_trace_msg)(char const   *format   4931 extern void ( /* format attribute */  vgDrd_trace_msg)(char const   *format
4916                                                        , ...) ;   4932                                                        , ...) ;
4917 extern void ( /* format attribute */  vgDrd_trace_msg_w_bt)(char const   *format   4933 extern void ( /* format attribute */  vgDrd_trace_msg_w_bt)(char const   *format
4918                                                             , ...) ;   4934                                                             , ...) ;
4919 extern Bool vgDrd_g_any_address_traced ;   4935 extern Bool vgDrd_g_any_address_traced ;
4920 extern void vgDrd_suppression_set_trace(Bool const   trace_suppression ) ;   4936 extern void vgDrd_suppression_set_trace(Bool const   trace_suppression ) ;
4921 extern void vgDrd_suppression_init(void) ;   4937 extern void vgDrd_suppression_init(void) ;
4922 extern void vgDrd_start_suppression(Addr const   a1 , Addr const   a2 ,   4938 extern void vgDrd_start_suppression(Addr const   a1 , Addr const   a2 ,
4923                                     char const   * const  reason ) ;   4939                                     char const   * const  reason ) ;
4924 extern void vgDrd_finish_suppression(Addr const   a1 , Addr const   a2 ) ;   4940 extern void vgDrd_finish_suppression(Addr const   a1 , Addr const   a2 ) ;
4925 extern Bool vgDrd_is_suppressed(Addr const   a1 , Addr const   a2 ) ;   4941 extern Bool vgDrd_is_suppressed(Addr const   a1 , Addr const   a2 ) ;
4926 extern Bool vgDrd_is_any_suppressed(Addr const   a1 , Addr const   a2 ) ;   4942 extern Bool vgDrd_is_any_suppressed(Addr const   a1 , Addr const   a2 ) ;
4927 extern void vgDrd_mark_hbvar(Addr const   a1 ) ;   4943 extern void vgDrd_mark_hbvar(Addr const   a1 ) ;
4928 extern Bool vgDrd_range_contains_suppression_or_hbvar(Addr const   a1 ,   4944 extern Bool vgDrd_range_contains_suppression_or_hbvar(Addr const   a1 ,
4929                                                       Addr const   a2 ) ;   4945                                                       Addr const   a2 ) ;
4930 extern void vgDrd_start_tracing_address_range(Addr const   a1 ,   4946 extern void vgDrd_start_tracing_address_range(Addr const   a1 ,
4931                                               Addr const   a2 ,   4947                                               Addr const   a2 ,
4932                                               Bool const   persistent ) ;   4948                                               Bool const   persistent ) ;
4933 extern void vgDrd_stop_tracing_address_range(Addr const   a1 , Addr const   a2 ) ;   4949 extern void vgDrd_stop_tracing_address_range(Addr const   a1 , Addr const   a2 ) ;
4934 extern Bool vgDrd_is_any_traced(Addr const   a1 , Addr const   a2 ) ;   4950 extern Bool vgDrd_is_any_traced(Addr const   a1 , Addr const   a2 ) ;
4935 extern void vgDrd_suppression_stop_using_mem(Addr const   a1 , Addr const   a2 ) ;   4951 extern void vgDrd_suppression_stop_using_mem(Addr const   a1 , Addr const   a2 ) ;
4936 __inline static Bool vgDrd_any_address_is_traced(void)   4952 __inline static Bool vgDrd_any_address_is_traced(void)
4937 {   4953 {
4938     4954  
4939     4955  
4940   {   4956   {
4941   return (vgDrd_g_any_address_traced);   4957   return (vgDrd_g_any_address_traced);
4942 }   4958 }
4943 }   4959 }
4944 extern UInt ( /* format attribute */  vgPlain_sprintf)(Char *buf ,   4960 extern UInt ( /* format attribute */  vgPlain_sprintf)(Char *buf ,
4945                                                        HChar const   *format   4961                                                        HChar const   *format
4946                                                        , ...) ;   4962                                                        , ...) ;
4947 extern UInt ( /* format attribute */  vgPlain_vsprintf)(Char *buf ,   4963 extern UInt ( /* format attribute */  vgPlain_vsprintf)(Char *buf ,
4948                                                         HChar const   *format ,   4964                                                         HChar const   *format ,
4949                                                         va_list vargs ) ;   4965                                                         va_list vargs ) ;
4950 extern UInt ( /* format attribute */  vgPlain_snprintf)(Char *buf , Int size ,   4966 extern UInt ( /* format attribute */  vgPlain_snprintf)(Char *buf , Int size ,
4951                                                         HChar const   *format   4967                                                         HChar const   *format
4952                                                         , ...) ;   4968                                                         , ...) ;
4953 extern UInt ( /* format attribute */  vgPlain_vsnprintf)(Char *buf , Int size ,   4969 extern UInt ( /* format attribute */  vgPlain_vsnprintf)(Char *buf , Int size ,
4954                                                          HChar const   *format ,   4970                                                          HChar const   *format ,
4955                                                          va_list vargs ) ;   4971                                                          va_list vargs ) ;
4956 extern void vgPlain_percentify(ULong n , ULong m , UInt d , Int n_buf ,   4972 extern void vgPlain_percentify(ULong n , ULong m , UInt d , Int n_buf ,
4957                                char *buf ) ;   4973                                char *buf ) ;
4958 extern UInt ( /* format attribute */  vgPlain_printf)(HChar const   *format   4974 extern UInt ( /* format attribute */  vgPlain_printf)(HChar const   *format
4959                                                       , ...) ;   4975                                                       , ...) ;
4960 extern UInt ( /* format attribute */  vgPlain_vprintf)(HChar const   *format ,   4976 extern UInt ( /* format attribute */  vgPlain_vprintf)(HChar const   *format ,
4961                                                        va_list vargs ) ;   4977                                                        va_list vargs ) ;
4962 extern UInt ( /* format attribute */  vgPlain_printf_xml)(HChar const   *format   4978 extern UInt ( /* format attribute */  vgPlain_printf_xml)(HChar const   *format
4963                                                           , ...) ;   4979                                                           , ...) ;
4964 extern UInt ( /* format attribute */  vgPlain_vprintf_xml)(HChar const   *format ,   4980 extern UInt ( /* format attribute */  vgPlain_vprintf_xml)(HChar const   *format ,
4965                                                            va_list vargs ) ;   4981                                                            va_list vargs ) ;
4966 extern void vgPlain_vcbprintf(void (*char_sink)(HChar  , void *opaque ) ,   4982 extern void vgPlain_vcbprintf(void (*char_sink)(HChar  , void *opaque ) ,
4967                               void *opaque , HChar const   *format ,   4983                               void *opaque , HChar const   *format ,
4968                               va_list vargs ) ;   4984                               va_list vargs ) ;
4969 extern UInt ( /* format attribute */  vgPlain_message)(VgMsgKind kind ,   4985 extern UInt ( /* format attribute */  vgPlain_message)(VgMsgKind kind ,
4970                                                        HChar const   *format   4986                                                        HChar const   *format
4971                                                        , ...) ;   4987                                                        , ...) ;
4972 extern UInt ( /* format attribute */  vgPlain_vmessage)(VgMsgKind kind ,   4988 extern UInt ( /* format attribute */  vgPlain_vmessage)(VgMsgKind kind ,
4973                                                         HChar const   *format ,   4989                                                         HChar const   *format ,
4974                                                         va_list vargs ) ;   4990                                                         va_list vargs ) ;
4975 extern UInt ( /* format attribute */  vgPlain_fmsg)(HChar const   *format  , ...) ;   4991 extern UInt ( /* format attribute */  vgPlain_fmsg)(HChar const   *format  , ...) ;
4976 extern  __attribute__((__noreturn__)) void ( /* format attribute */  vgPlain_fmsg_bad_option)(HChar *opt ,   4992 extern  __attribute__((__noreturn__)) void ( /* format attribute */  vgPlain_fmsg_bad_option)(HChar *opt ,
4977                                                                                               HChar const   *format   4993                                                                                               HChar const   *format
4978                                                                                               , ...) ;   4994                                                                                               , ...) ;
4979 extern UInt ( /* format attribute */  vgPlain_umsg)(HChar const   *format  , ...) ;   4995 extern UInt ( /* format attribute */  vgPlain_umsg)(HChar const   *format  , ...) ;
4980 extern UInt ( /* format attribute */  vgPlain_dmsg)(HChar const   *format  , ...) ;   4996 extern UInt ( /* format attribute */  vgPlain_dmsg)(HChar const   *format  , ...) ;
4981 extern void vgPlain_message_flush(void) ;   4997 extern void vgPlain_message_flush(void) ;
4982 extern Addr vgPlain_get_IP(ThreadId tid ) ;   4998 extern Addr vgPlain_get_IP(ThreadId tid ) ;
4983 extern Addr vgPlain_get_SP(ThreadId tid ) ;   4999 extern Addr vgPlain_get_SP(ThreadId tid ) ;
4984 extern void vgPlain_get_shadow_regs_area(ThreadId tid , UChar *dst ,   5000 extern void vgPlain_get_shadow_regs_area(ThreadId tid , UChar *dst ,
4985                                          Int shadowNo , PtrdiffT offset ,   5001                                          Int shadowNo , PtrdiffT offset ,
4986                                          SizeT size ) ;   5002                                          SizeT size ) ;
4987 extern void vgPlain_set_shadow_regs_area(ThreadId tid , Int shadowNo ,   5003 extern void vgPlain_set_shadow_regs_area(ThreadId tid , Int shadowNo ,
4988                                          PtrdiffT offset , SizeT size ,   5004                                          PtrdiffT offset , SizeT size ,
4989                                          UChar const   *src ) ;   5005                                          UChar const   *src ) ;
4990 extern void vgPlain_set_syscall_return_shadows(ThreadId tid , UWord s1res ,   5006 extern void vgPlain_set_syscall_return_shadows(ThreadId tid , UWord s1res ,
4991                                                UWord s2res , UWord s1err ,   5007                                                UWord s2res , UWord s1err ,
4992                                                UWord s2err ) ;   5008                                                UWord s2err ) ;
4993 extern void vgPlain_apply_to_GP_regs(void (*f)(ThreadId tid , HChar *regname ,   5009 extern void vgPlain_apply_to_GP_regs(void (*f)(ThreadId tid , HChar *regname ,
4994                                                UWord val ) ) ;   5010                                                UWord val ) ) ;
4995 extern void vgPlain_thread_stack_reset_iter(ThreadId *tid ) ;   5011 extern void vgPlain_thread_stack_reset_iter(ThreadId *tid ) ;
4996 extern Bool vgPlain_thread_stack_next(ThreadId *tid , Addr *stack_min ,   5012 extern Bool vgPlain_thread_stack_next(ThreadId *tid , Addr *stack_min ,
4997                                       Addr *stack_max ) ;   5013                                       Addr *stack_max ) ;
4998 extern Addr vgPlain_thread_get_stack_max(ThreadId tid ) ;   5014 extern Addr vgPlain_thread_get_stack_max(ThreadId tid ) ;
4999 extern SizeT vgPlain_thread_get_stack_size(ThreadId tid ) ;   5015 extern SizeT vgPlain_thread_get_stack_size(ThreadId tid ) ;
5000 extern Addr vgPlain_thread_get_altstack_min(ThreadId tid ) ;   5016 extern Addr vgPlain_thread_get_altstack_min(ThreadId tid ) ;
5001 extern SizeT vgPlain_thread_get_altstack_size(ThreadId tid ) ;   5017 extern SizeT vgPlain_thread_get_altstack_size(ThreadId tid ) ;
5002 extern void *vgPlain_fnptr_to_fnentry(void * ) ;   5018 extern void *vgPlain_fnptr_to_fnentry(void * ) ;
5003 extern void *vgPlain_malloc(HChar *cc , SizeT nbytes ) ;   5019 extern void *vgPlain_malloc(HChar *cc , SizeT nbytes ) ;
5004 extern void vgPlain_free(void *p ) ;   5020 extern void vgPlain_free(void *p ) ;
5005 extern void *vgPlain_calloc(HChar *cc , SizeT n , SizeT bytes_per_elem ) ;   5021 extern void *vgPlain_calloc(HChar *cc , SizeT n , SizeT bytes_per_elem ) ;
5006 extern void *vgPlain_realloc(HChar *cc , void *p , SizeT size ) ;   5022 extern void *vgPlain_realloc(HChar *cc , void *p , SizeT size ) ;
5007 extern Char *vgPlain_strdup(HChar *cc , Char const   *s ) ;   5023 extern Char *vgPlain_strdup(HChar *cc , Char const   *s ) ;
5008 extern SizeT vgPlain_malloc_usable_size(void *p ) ;   5024 extern SizeT vgPlain_malloc_usable_size(void *p ) ;
5009 extern  __attribute__((__noreturn__)) void vgPlain_out_of_memory_NORETURN(HChar *who ,   5025 extern  __attribute__((__noreturn__)) void vgPlain_out_of_memory_NORETURN(HChar *who ,
5010                                                                           SizeT szB ) ;   5026                                                                           SizeT szB ) ;
5011 static void bm2_merge(struct bitmap2 * const  bm2l ,   5027 static void bm2_merge(struct bitmap2 * const  bm2l ,
5012                       struct bitmap2  const  * const  bm2r ) ;   5028                       struct bitmap2  const  * const  bm2r ) ;
5013 static void bm2_print(struct bitmap2  const  * const  bm2 ) ;   5029 static void bm2_print(struct bitmap2  const  * const  bm2 ) ;
5014 static OSet *s_bm2_set_template  ;   5030 static OSet *s_bm2_set_template  ;
5015 static ULong s_bitmap_creation_count  ;   5031 static ULong s_bitmap_creation_count  ;
5016 static ULong s_bitmap_merge_count  ;   5032 static ULong s_bitmap_merge_count  ;
5017 static ULong s_bitmap2_merge_count  ;   5033 static ULong s_bitmap2_merge_count  ;
5018 void vgDrd_bm_module_init(void)   5034 void vgDrd_bm_module_init(void)
5019 {   5035 {
5020   long tmp ;   5036   long tmp ;
5021     5037  
5022   {   5038   {
5023   tmp = __builtin_expect((long )(! (! (! s_bm2_set_template))), 1L);   5039   tmp = __builtin_expect((long )(! (! (! s_bm2_set_template))), 1L);
5024   if (tmp) {   5040   if (tmp) {
5025     5041  
5026   } else {   5042   } else {
5027     vgPlain_assert_fail((Bool )0, (Char const   *)"!s_bm2_set_template",   5043     vgPlain_assert_fail((Bool )0, (Char const   *)"!s_bm2_set_template",
5028                         (Char const   *)"drd_bitmap.c", 58,   5044                         (Char const   *)"drd_bitmap.c", 58,
5029                         (Char const   *)"vgDrd_bm_module_init", "");   5045                         (Char const   *)"vgDrd_bm_module_init", "");
5030   }   5046   }
5031   s_bm2_set_template = vgPlain_OSetGen_Create_With_Pool((PtrdiffT )0,   5047   s_bm2_set_template = vgPlain_OSetGen_Create_With_Pool((PtrdiffT )0,
5032                                                         (Word (*)(void const   *key ,   5048                                                         (Word (*)(void const   *key ,
5033                                                                   void const   *elem ))0,   5049                                                                   void const   *elem ))0,
5034                                                         & vgPlain_malloc,   5050                                                         & vgPlain_malloc,
5035                                                         (HChar *)"drd.bitmap.bn.2",   5051                                                         (HChar *)"drd.bitmap.bn.2",
5036                                                         & vgPlain_free,   5052                                                         & vgPlain_free,
5037                                                         (SizeT )512,   5053                                                         (SizeT )512,
5038                                                         (SizeT )sizeof(struct bitmap2 ));   5054                                                         (SizeT )sizeof(struct bitmap2 ));
5039   return;   5055   return;
5040 }   5056 }
5041 }   5057 }
5042 void vgDrd_bm_module_cleanup(void)   5058 void vgDrd_bm_module_cleanup(void)
5043 {   5059 {
5044   long tmp ;   5060   long tmp ;
5045     5061  
5046   {   5062   {
5047   tmp = __builtin_expect((long )(! (! s_bm2_set_template)), 1L);   5063   tmp = __builtin_expect((long )(! (! s_bm2_set_template)), 1L);
5048   if (tmp) {   5064   if (tmp) {
5049     5065  
5050   } else {   5066   } else {
5051     vgPlain_assert_fail((Bool )0, (Char const   *)"s_bm2_set_template",   5067     vgPlain_assert_fail((Bool )0, (Char const   *)"s_bm2_set_template",
5052                         (Char const   *)"drd_bitmap.c", 66,   5068                         (Char const   *)"drd_bitmap.c", 66,
5053                         (Char const   *)"vgDrd_bm_module_cleanup", "");   5069                         (Char const   *)"vgDrd_bm_module_cleanup", "");
5054   }   5070   }
5055   vgPlain_OSetGen_Destroy(s_bm2_set_template);   5071   vgPlain_OSetGen_Destroy(s_bm2_set_template);
5056   s_bm2_set_template = (OSet *)((void *)0);   5072   s_bm2_set_template = (OSet *)((void *)0);
5057   return;   5073   return;
5058 }   5074 }
5059 }   5075 }
5060 struct bitmap *vgDrd_bm_new(void)   5076 struct bitmap *vgDrd_bm_new(void)
5061 {   5077 {
5062   struct bitmap *bm ;   5078   struct bitmap *bm ;
5063   long tmp ;   5079   long tmp ;
5064   void *tmp___0 ;   5080   void *tmp___0 ;
5065     5081  
5066   {   5082   {
5067   tmp = __builtin_expect((long )(! (! ((unsigned int )(1 << 5) == 8U * sizeof(UWord )))),   5083   tmp = __builtin_expect((long )(! (! ((unsigned int )(1 << 5) == 8U * sizeof(UWord )))),
5068                          1L);   5084                          1L);
5069   if (tmp) {   5085   if (tmp) {
5070     5086  
5071   } else {   5087   } else {
5072     vgPlain_assert_fail((Bool )0,   5088     vgPlain_assert_fail((Bool )0,
5073                         (Char const   *)"(1 << BITS_PER_BITS_PER_UWORD) == BITS_PER_UWORD",   5089                         (Char const   *)"(1 << BITS_PER_BITS_PER_UWORD) == BITS_PER_UWORD",
5074                         (Char const   *)"drd_bitmap.c", 77,   5090                         (Char const   *)"drd_bitmap.c", 77,
5075                         (Char const   *)"vgDrd_bm_new", "");   5091                         (Char const   *)"vgDrd_bm_new", "");
5076   }   5092   }
5077   tmp___0 = vgPlain_malloc((HChar *)"drd.bitmap.bn.1", (SizeT )sizeof(*bm));   5093   tmp___0 = vgPlain_malloc((HChar *)"drd.bitmap.bn.1", (SizeT )sizeof(*bm));
5078   bm = (struct bitmap *)tmp___0;   5094   bm = (struct bitmap *)tmp___0;
5079   vgDrd_bm_init((struct bitmap */* const  */)bm);   5095   vgDrd_bm_init((struct bitmap */* const  */)bm);
5080   return (bm);   5096   return (bm);
5081 }   5097 }
5082 }   5098 }
5083 void vgDrd_bm_delete(struct bitmap * const  bm )   5099 void vgDrd_bm_delete(struct bitmap * const  bm )
5084 {   5100 {
5085   long tmp ;   5101   long tmp ;
5086     5102  
5087   {   5103   {
5088   tmp = __builtin_expect((long )(! (! bm)), 1L);   5104   tmp = __builtin_expect((long )(! (! bm)), 1L);
5089   if (tmp) {   5105   if (tmp) {
5090     5106  
5091   } else {   5107   } else {
5092     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",   5108     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",
5093                         (Char const   *)"drd_bitmap.c", 87,   5109                         (Char const   *)"drd_bitmap.c", 87,
5094                         (Char const   *)"vgDrd_bm_delete", "");   5110                         (Char const   *)"vgDrd_bm_delete", "");
5095   }   5111   }
5096   vgDrd_bm_cleanup(bm);   5112   vgDrd_bm_cleanup(bm);
5097   vgPlain_free((void *)bm);   5113   vgPlain_free((void *)bm);
5098   return;   5114   return;
5099 }   5115 }
5100 }   5116 }
5101 void vgDrd_bm_init(struct bitmap * const  bm )   5117 void vgDrd_bm_init(struct bitmap * const  bm )
5102 {   5118 {
5103   unsigned int i ;   5119   unsigned int i ;
5104   long tmp ;   5120   long tmp ;
5105     5121  
5106   {   5122   {
5107   tmp = __builtin_expect((long )(! (! bm)), 1L);   5123   tmp = __builtin_expect((long )(! (! bm)), 1L);
5108   if (tmp) {   5124   if (tmp) {
5109     5125  
5110   } else {   5126   } else {
5111     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",   5127     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",
5112                         (Char const   *)"drd_bitmap.c", 98,   5128                         (Char const   *)"drd_bitmap.c", 98,
5113                         (Char const   *)"vgDrd_bm_init", "");   5129                         (Char const   *)"vgDrd_bm_init", "");
5114   }   5130   }
5115   i = 0U;   5131   i = 0U;
5116   while (i < 4U) {   5132   while (i < 4U) {
5117     bm->cache[i].a1 = ~ ((UWord )1);   5133     bm->cache[i].a1 = ~ ((UWord )1);
5118     bm->cache[i].bm2 = (struct bitmap2 *)0;   5134     bm->cache[i].bm2 = (struct bitmap2 *)0;
5119     i ++;   5135     i ++;
5120   }   5136   }
5121   bm->oset = vgPlain_OSetGen_EmptyClone(s_bm2_set_template);   5137   bm->oset = vgPlain_OSetGen_EmptyClone(s_bm2_set_template);
5122   s_bitmap_creation_count ++;   5138   s_bitmap_creation_count ++;
5123   return;   5139   return;
5124 }   5140 }
5125 }   5141 }
5126 void vgDrd_bm_cleanup(struct bitmap * const  bm )   5142 void vgDrd_bm_cleanup(struct bitmap * const  bm )
5127 {   5143 {
5128     5144  
5129     5145  
5130   {   5146   {
5131   vgPlain_OSetGen_Destroy(bm->oset);   5147   vgPlain_OSetGen_Destroy(bm->oset);
5132   return;   5148   return;
5133 }   5149 }
5134 }   5150 }
5135 void vgDrd_bm_access_range(struct bitmap * const  bm , Addr const   a1 ,   5151 void vgDrd_bm_access_range(struct bitmap * const  bm , Addr const   a1 ,
5136                            Addr const   a2 , BmAccessTypeT const   access_type )   5152                            Addr const   a2 , BmAccessTypeT const   access_type )
5137 {   5153 {
5138   int tmp ;   5154   int tmp ;
5139   long tmp___0 ;   5155   long tmp___0 ;
5140     5156  
5141   {   5157   {
5142   if ((unsigned int const   )access_type == 0U) {   5158   if ((unsigned int const   )access_type == 0U) {
5143     tmp = 1;   5159     tmp = 1;
5144   } else   5160   } else
5145   if ((unsigned int const   )access_type == 1U) {   5161   if ((unsigned int const   )access_type == 1U) {
5146     tmp = 1;   5162     tmp = 1;
5147   } else {   5163   } else {
5148     tmp = 0;   5164     tmp = 0;
5149   }   5165   }
5150   tmp___0 = __builtin_expect((long )tmp, 1L);   5166   tmp___0 = __builtin_expect((long )tmp, 1L);
5151   if (tmp___0) {   5167   if (tmp___0) {
5152     5168  
5153   } else {   5169   } else {
5154     vgPlain_assert_fail((Bool )0,   5170     vgPlain_assert_fail((Bool )0,
5155                         (Char const   *)"access_type == eLoad || access_type == eStore",   5171                         (Char const   *)"access_type == eLoad || access_type == eStore",
5156                         (Char const   *)"drd_bitmap.c", 133,   5172                         (Char const   *)"drd_bitmap.c", 133,
5157                         (Char const   *)"vgDrd_bm_access_range", "");   5173                         (Char const   *)"vgDrd_bm_access_range", "");
5158   }   5174   }
5159   if ((unsigned int const   )access_type == 0U) {   5175   if ((unsigned int const   )access_type == 0U) {
5160     vgDrd_bm_access_range_load(bm, a1, a2);   5176     vgDrd_bm_access_range_load(bm, a1, a2);
5161     return;   5177     return;
5162   } else {   5178   } else {
5163     vgDrd_bm_access_range_store(bm, a1, a2);   5179     vgDrd_bm_access_range_store(bm, a1, a2);
5164     return;   5180     return;
5165   }   5181   }
5166 }   5182 }
5167 }   5183 }
5168 void vgDrd_bm_access_range_load(struct bitmap * const  bm , Addr const   a1 ,   5184 void vgDrd_bm_access_range_load(struct bitmap * const  bm , Addr const   a1 ,
5169                                 Addr const   a2 )   5185                                 Addr const   a2 )
5170 {   5186 {
5171   Addr b ;   5187   Addr b ;
5172   Addr b_next ;   5188   Addr b_next ;
5173   long tmp ;   5189   long tmp ;
5174   long tmp___0 ;   5190   long tmp___0 ;
5175   Addr tmp___1 ;   5191   Addr tmp___1 ;
5176   int tmp___2 ;   5192   int tmp___2 ;
5177   long tmp___3 ;   5193   long tmp___3 ;
5178   Addr tmp___4 ;   5194   Addr tmp___4 ;
5179   int tmp___5 ;   5195   int tmp___5 ;
5180   long tmp___6 ;   5196   long tmp___6 ;
5181   Addr tmp___7 ;   5197   Addr tmp___7 ;
5182   int tmp___8 ;   5198   int tmp___8 ;
5183   long tmp___9 ;   5199   long tmp___9 ;
5184   Addr b_start ;   5200   Addr b_start ;
5185   Addr b_end ;   5201   Addr b_end ;
5186   struct bitmap2 *bm2 ;   5202   struct bitmap2 *bm2 ;
5187   UWord b0 ;   5203   UWord b0 ;
5188   UWord tmp___10 ;   5204   UWord tmp___10 ;
5189   long tmp___11 ;   5205   long tmp___11 ;
5190   Addr tmp___12 ;   5206   Addr tmp___12 ;
5191   Addr tmp___13 ;   5207   Addr tmp___13 ;
5192   Addr tmp___14 ;   5208   Addr tmp___14 ;
5193   int tmp___15 ;   5209   int tmp___15 ;
5194   long tmp___16 ;   5210   long tmp___16 ;
5195   UWord tmp___17 ;   5211   UWord tmp___17 ;
5196   UWord tmp___18 ;   5212   UWord tmp___18 ;
5197   int tmp___19 ;   5213   int tmp___19 ;
5198   long tmp___20 ;   5214   long tmp___20 ;
5199   UWord tmp___21 ;   5215   UWord tmp___21 ;
5200   UWord tmp___22 ;   5216   UWord tmp___22 ;
5201   int tmp___23 ;   5217   int tmp___23 ;
5202   long tmp___24 ;   5218   long tmp___24 ;
5203   unsigned int k ;   5219   unsigned int k ;
5204   UWord tmp___25 ;   5220   UWord tmp___25 ;
5205   UWord tmp___26 ;   5221   UWord tmp___26 ;
5206   UWord tmp___27 ;   5222   UWord tmp___27 ;
5207     5223  
5208   {   5224   {
5209   tmp = __builtin_expect((long )(! (! bm)), 1L);   5225   tmp = __builtin_expect((long )(! (! bm)), 1L);
5210   if (tmp) {   5226   if (tmp) {
5211     5227  
5212   } else {   5228   } else {
5213     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",   5229     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",
5214                         (Char const   *)"drd_bitmap.c", 145,   5230                         (Char const   *)"drd_bitmap.c", 145,
5215                         (Char const   *)"vgDrd_bm_access_range_load", "");   5231                         (Char const   *)"vgDrd_bm_access_range_load", "");
5216   }   5232   }
5217   tmp___0 = __builtin_expect((long )(! (! (a1 <= a2))), 1L);   5233   tmp___0 = __builtin_expect((long )(! (! (a1 <= a2))), 1L);
5218   if (tmp___0) {   5234   if (tmp___0) {
5219     5235  
5220   } else {   5236   } else {
5221     vgPlain_assert_fail((Bool )0, (Char const   *)"a1 <= a2",   5237     vgPlain_assert_fail((Bool )0, (Char const   *)"a1 <= a2",
5222                         (Char const   *)"drd_bitmap.c", 146,   5238                         (Char const   *)"drd_bitmap.c", 146,
5223                         (Char const   *)"vgDrd_bm_access_range_load", "");   5239                         (Char const   *)"vgDrd_bm_access_range_load", "");
5224   }   5240   }
5225   tmp___1 = first_address_with_higher_msb(a2);   5241   tmp___1 = first_address_with_higher_msb(a2);
5226   if (a2 < (Addr const   )tmp___1) {   5242   if (a2 < (Addr const   )tmp___1) {
5227     tmp___2 = 1;   5243     tmp___2 = 1;
5228   } else {   5244   } else {
5229     tmp___2 = 0;   5245     tmp___2 = 0;
5230   }   5246   }
5231   tmp___3 = __builtin_expect((long )tmp___2, 1L);   5247   tmp___3 = __builtin_expect((long )tmp___2, 1L);
5232   if (tmp___3) {   5248   if (tmp___3) {
5233     5249  
5234   } else {   5250   } else {
5235     vgPlain_assert_fail((Bool )0,   5251     vgPlain_assert_fail((Bool )0,
5236                         (Char const   *)"a2 < first_address_with_higher_msb(a2)",   5252                         (Char const   *)"a2 < first_address_with_higher_msb(a2)",
5237                         (Char const   *)"drd_bitmap.c", 147,   5253                         (Char const   *)"drd_bitmap.c", 147,
5238                         (Char const   *)"vgDrd_bm_access_range_load", "");   5254                         (Char const   *)"vgDrd_bm_access_range_load", "");
5239   }   5255   }
5240   tmp___4 = first_address_with_same_lsb(a1);   5256   tmp___4 = first_address_with_same_lsb(a1);
5241   if (a1 == (Addr const   )tmp___4) {   5257   if (a1 == (Addr const   )tmp___4) {
5242     tmp___5 = 1;   5258     tmp___5 = 1;
5243   } else {   5259   } else {
5244     tmp___5 = 0;   5260     tmp___5 = 0;
5245   }   5261   }
5246   tmp___6 = __builtin_expect((long )tmp___5, 1L);   5262   tmp___6 = __builtin_expect((long )tmp___5, 1L);
5247   if (tmp___6) {   5263   if (tmp___6) {
5248     5264  
5249   } else {   5265   } else {
5250     vgPlain_assert_fail((Bool )0,   5266     vgPlain_assert_fail((Bool )0,
5251                         (Char const   *)"a1 == first_address_with_same_lsb(a1)",   5267                         (Char const   *)"a1 == first_address_with_same_lsb(a1)",
5252                         (Char const   *)"drd_bitmap.c", 148,   5268                         (Char const   *)"drd_bitmap.c", 148,
5253                         (Char const   *)"vgDrd_bm_access_range_load", "");   5269                         (Char const   *)"vgDrd_bm_access_range_load", "");
5254   }   5270   }
5255   tmp___7 = first_address_with_same_lsb(a2);   5271   tmp___7 = first_address_with_same_lsb(a2);
5256   if (a2 == (Addr const   )tmp___7) {   5272   if (a2 == (Addr const   )tmp___7) {
5257     tmp___8 = 1;   5273     tmp___8 = 1;
5258   } else {   5274   } else {
5259     tmp___8 = 0;   5275     tmp___8 = 0;
5260   }   5276   }
5261   tmp___9 = __builtin_expect((long )tmp___8, 1L);   5277   tmp___9 = __builtin_expect((long )tmp___8, 1L);
5262   if (tmp___9) {   5278   if (tmp___9) {
5263     5279  
5264   } else {   5280   } else {
5265     vgPlain_assert_fail((Bool )0,   5281     vgPlain_assert_fail((Bool )0,
5266                         (Char const   *)"a2 == first_address_with_same_lsb(a2)",   5282                         (Char const   *)"a2 == first_address_with_same_lsb(a2)",
5267                         (Char const   *)"drd_bitmap.c", 149,   5283                         (Char const   *)"drd_bitmap.c", 149,
5268                         (Char const   *)"vgDrd_bm_access_range_load", "");   5284                         (Char const   *)"vgDrd_bm_access_range_load", "");
5269   }   5285   }
5270   b = (Addr )a1;   5286   b = (Addr )a1;
5271   while (b < (Addr )a2) {   5287   while (b < (Addr )a2) {
5272     b_next = first_address_with_higher_msb((Addr const   )b);   5288     b_next = first_address_with_higher_msb((Addr const   )b);
5273     if (b_next > (Addr )a2) {   5289     if (b_next > (Addr )a2) {
5274       b_next = (Addr )a2;   5290       b_next = (Addr )a2;
5275     } else {   5291     } else {
5276     5292  
5277     }   5293     }
5278     tmp___10 = address_msb((Addr const   )b);   5294     tmp___10 = address_msb((Addr const   )b);
5279     bm2 = bm2_lookup_or_insert_exclusive(bm, (UWord const   )tmp___10);   5295     bm2 = bm2_lookup_or_insert_exclusive(bm, (UWord const   )tmp___10);
5280     tmp___11 = __builtin_expect((long )(! (! bm2)), 1L);   5296     tmp___11 = __builtin_expect((long )(! (! bm2)), 1L);
5281     if (tmp___11) {   5297     if (tmp___11) {
5282     5298  
5283     } else {   5299     } else {
5284       vgPlain_assert_fail((Bool )0, (Char const   *)"bm2",   5300       vgPlain_assert_fail((Bool )0, (Char const   *)"bm2",
5285                           (Char const   *)"drd_bitmap.c", 165,   5301                           (Char const   *)"drd_bitmap.c", 165,
5286                           (Char const   *)"vgDrd_bm_access_range_load", "");   5302                           (Char const   *)"vgDrd_bm_access_range_load", "");
5287     }   5303     }
5288     tmp___13 = make_address((UWord const   )bm2->addr, (UWord const   )0);   5304     tmp___13 = make_address((UWord const   )bm2->addr, (UWord const   )0);
5289     if (tmp___13 < (Addr )a1) {   5305     if (tmp___13 < (Addr )a1) {
5290       b_start = (Addr )a1;   5306       b_start = (Addr )a1;
5291     } else {   5307     } else {
5292       tmp___12 = make_address((UWord const   )bm2->addr, (UWord const   )0);   5308       tmp___12 = make_address((UWord const   )bm2->addr, (UWord const   )0);
5293       if (tmp___12 < (Addr )a2) {   5309       if (tmp___12 < (Addr )a2) {
5294         b_start = make_address((UWord const   )bm2->addr, (UWord const   )0);   5310         b_start = make_address((UWord const   )bm2->addr, (UWord const   )0);
5295       } else {   5311       } else {
5296         break;   5312         break;
5297       }   5313       }
5298     }   5314     }
5299     tmp___14 = make_address((UWord const   )(bm2->addr + 1UL), (UWord const   )0);   5315     tmp___14 = make_address((UWord const   )(bm2->addr + 1UL), (UWord const   )0);
5300     if (tmp___14 < (Addr )a2) {   5316     if (tmp___14 < (Addr )a2) {
5301       b_end = make_address((UWord const   )(bm2->addr + 1UL), (UWord const   )0);   5317       b_end = make_address((UWord const   )(bm2->addr + 1UL), (UWord const   )0);
5302     } else {   5318     } else {
5303       b_end = (Addr )a2;   5319       b_end = (Addr )a2;
5304     }   5320     }
5305     if (a1 <= (Addr const   )b_start) {   5321     if (a1 <= (Addr const   )b_start) {
5306       if (b_start < b_end) {   5322       if (b_start < b_end) {
5307         if (b_end) {   5323         if (b_end) {
5308           if (b_end <= (Addr )a2) {   5324           if (b_end <= (Addr )a2) {
5309             tmp___15 = 1;   5325             tmp___15 = 1;
5310           } else {   5326           } else {
5311             tmp___15 = 0;   5327             tmp___15 = 0;
5312           }   5328           }
5313         } else {   5329         } else {
5314           tmp___15 = 0;   5330           tmp___15 = 0;
5315         }   5331         }
5316       } else {   5332       } else {
5317         tmp___15 = 0;   5333         tmp___15 = 0;
5318       }   5334       }
5319     } else {   5335     } else {
5320       tmp___15 = 0;   5336       tmp___15 = 0;
5321     }   5337     }
5322     tmp___16 = __builtin_expect((long )tmp___15, 1L);   5338     tmp___16 = __builtin_expect((long )tmp___15, 1L);
5323     if (tmp___16) {   5339     if (tmp___16) {
5324     5340  
5325     } else {   5341     } else {
5326       vgPlain_assert_fail((Bool )0,   5342       vgPlain_assert_fail((Bool )0,
5327                           (Char const   *)"a1 <= b_start && b_start < b_end && b_end && b_end <= a2",   5343                           (Char const   *)"a1 <= b_start && b_start < b_end && b_end && b_end <= a2",
5328                           (Char const   *)"drd_bitmap.c", 180,   5344                           (Char const   *)"drd_bitmap.c", 180,
5329                           (Char const   *)"vgDrd_bm_access_range_load", "");   5345                           (Char const   *)"vgDrd_bm_access_range_load", "");
5330     }   5346     }
5331     tmp___17 = address_msb((Addr const   )b_start);   5347     tmp___17 = address_msb((Addr const   )b_start);
5332     tmp___18 = address_msb((Addr const   )(b_end - 1UL));   5348     tmp___18 = address_msb((Addr const   )(b_end - 1UL));
5333     if (tmp___17 == tmp___18) {   5349     if (tmp___17 == tmp___18) {
5334       tmp___19 = 1;   5350       tmp___19 = 1;
5335     } else {   5351     } else {
5336       tmp___19 = 0;   5352       tmp___19 = 0;
5337     }   5353     }
5338     tmp___20 = __builtin_expect((long )tmp___19, 1L);   5354     tmp___20 = __builtin_expect((long )tmp___19, 1L);
5339     if (tmp___20) {   5355     if (tmp___20) {
5340     5356  
5341     } else {   5357     } else {
5342       vgPlain_assert_fail((Bool )0,   5358       vgPlain_assert_fail((Bool )0,
5343                           (Char const   *)"address_msb(b_start) == address_msb(b_end - 1)",   5359                           (Char const   *)"address_msb(b_start) == address_msb(b_end - 1)",
5344                           (Char const   *)"drd_bitmap.c", 181,   5360                           (Char const   *)"drd_bitmap.c", 181,
5345                           (Char const   *)"vgDrd_bm_access_range_load", "");   5361                           (Char const   *)"vgDrd_bm_access_range_load", "");
5346     }   5362     }
5347     tmp___21 = address_lsb((Addr const   )b_start);   5363     tmp___21 = address_lsb((Addr const   )b_start);
5348     tmp___22 = address_lsb((Addr const   )(b_end - 1UL));   5364     tmp___22 = address_lsb((Addr const   )(b_end - 1UL));
5349     if (tmp___21 <= tmp___22) {   5365     if (tmp___21 <= tmp___22) {
5350       tmp___23 = 1;   5366       tmp___23 = 1;
5351     } else {   5367     } else {
5352       tmp___23 = 0;   5368       tmp___23 = 0;
5353     }   5369     }
5354     tmp___24 = __builtin_expect((long )tmp___23, 1L);   5370     tmp___24 = __builtin_expect((long )tmp___23, 1L);
5355     if (tmp___24) {   5371     if (tmp___24) {
5356     5372  
5357     } else {   5373     } else {
5358       vgPlain_assert_fail((Bool )0,   5374       vgPlain_assert_fail((Bool )0,
5359                           (Char const   *)"address_lsb(b_start) <= address_lsb(b_end - 1)",   5375                           (Char const   *)"address_lsb(b_start) <= address_lsb(b_end - 1)",
5360                           (Char const   *)"drd_bitmap.c", 182,   5376                           (Char const   *)"drd_bitmap.c", 182,
5361                           (Char const   *)"vgDrd_bm_access_range_load", "");   5377                           (Char const   *)"vgDrd_bm_access_range_load", "");
5362     }   5378     }
5363     tmp___26 = address_lsb((Addr const   )b_start);   5379     tmp___26 = address_lsb((Addr const   )b_start);
5364     if (tmp___26 == 0UL) {   5380     if (tmp___26 == 0UL) {
5365       tmp___27 = address_lsb((Addr const   )b_end);   5381       tmp___27 = address_lsb((Addr const   )b_end);
5366       if (tmp___27 == 0UL) {   5382       if (tmp___27 == 0UL) {
5367         k = 0U;   5383         k = 0U;
5368         while (k < 1U << 7) {   5384         while (k < 1U << 7) {
5369           bm2->bm1.bm0_r[k] = ~ ((UWord )0);   5385           bm2->bm1.bm0_r[k] = ~ ((UWord )0);
5370           k ++;   5386           k ++;
5371         }   5387         }
5372       } else {   5388       } else {
5373         goto _L;   5389         goto _L;
5374       }   5390       }
5375     } else {   5391     } else {
5376       _L: /* CIL Label */   5392       _L: /* CIL Label */
5377       b0 = address_lsb((Addr const   )b_start);   5393       b0 = address_lsb((Addr const   )b_start);
5378       while (1) {   5394       while (1) {
5379         tmp___25 = address_lsb((Addr const   )(b_end - 1UL));   5395         tmp___25 = address_lsb((Addr const   )(b_end - 1UL));
5380         if (b0 <= tmp___25) {   5396         if (b0 <= tmp___25) {
5381     5397  
5382         } else {   5398         } else {
5383           break;   5399           break;
5384         }   5400         }
5385         bm0_set(bm2->bm1.bm0_r, (UWord const   )b0);   5401         bm0_set(bm2->bm1.bm0_r, (UWord const   )b0);
5386         b0 ++;   5402         b0 ++;
5387       }   5403       }
5388     }   5404     }
5389     b = b_next;   5405     b = b_next;
5390   }   5406   }
5391   return;   5407   return;
5392 }   5408 }
5393 }   5409 }
5394 void vgDrd_bm_access_load_1(struct bitmap * const  bm , Addr const   a1 )   5410 void vgDrd_bm_access_load_1(struct bitmap * const  bm , Addr const   a1 )
5395 {   5411 {
5396     5412  
5397     5413  
5398   {   5414   {
5399   bm_access_aligned_load(bm, a1, (SizeT const   )1);   5415   bm_access_aligned_load(bm, a1, (SizeT const   )1);
5400   return;   5416   return;
5401 }   5417 }
5402 }   5418 }
5403 void vgDrd_bm_access_load_2(struct bitmap * const  bm , Addr const   a1 )   5419 void vgDrd_bm_access_load_2(struct bitmap * const  bm , Addr const   a1 )
5404 {   5420 {
5405     5421  
5406     5422  
5407   {   5423   {
5408   if ((a1 & 1UL) == 0UL) {   5424   if ((a1 & 1UL) == 0UL) {
5409     bm_access_aligned_load(bm, a1, (SizeT const   )2);   5425     bm_access_aligned_load(bm, a1, (SizeT const   )2);
5410   } else {   5426   } else {
5411     vgDrd_bm_access_range(bm, a1, a1 + 2UL, (BmAccessTypeT const   )0);   5427     vgDrd_bm_access_range(bm, a1, a1 + 2UL, (BmAccessTypeT const   )0);
5412   }   5428   }
5413   return;   5429   return;
5414 }   5430 }
5415 }   5431 }
5416 void vgDrd_bm_access_load_4(struct bitmap * const  bm , Addr const   a1 )   5432 void vgDrd_bm_access_load_4(struct bitmap * const  bm , Addr const   a1 )
5417 {   5433 {
5418     5434  
5419     5435  
5420   {   5436   {
5421   if ((a1 & 3UL) == 0UL) {   5437   if ((a1 & 3UL) == 0UL) {
5422     bm_access_aligned_load(bm, a1, (SizeT const   )4);   5438     bm_access_aligned_load(bm, a1, (SizeT const   )4);
5423   } else {   5439   } else {
5424     vgDrd_bm_access_range(bm, a1, a1 + 4UL, (BmAccessTypeT const   )0);   5440     vgDrd_bm_access_range(bm, a1, a1 + 4UL, (BmAccessTypeT const   )0);
5425   }   5441   }
5426   return;   5442   return;
5427 }   5443 }
5428 }   5444 }
5429 void vgDrd_bm_access_load_8(struct bitmap * const  bm , Addr const   a1 )   5445 void vgDrd_bm_access_load_8(struct bitmap * const  bm , Addr const   a1 )
5430 {   5446 {
5431     5447  
5432     5448  
5433   {   5449   {
5434   if ((a1 & 7UL) == 0UL) {   5450   if ((a1 & 7UL) == 0UL) {
5435     bm_access_aligned_load(bm, a1, (SizeT const   )8);   5451     bm_access_aligned_load(bm, a1, (SizeT const   )8);
5436   } else   5452   } else
5437   if ((a1 & 3UL) == 0UL) {   5453   if ((a1 & 3UL) == 0UL) {
5438     bm_access_aligned_load(bm, a1, (SizeT const   )4);   5454     bm_access_aligned_load(bm, a1, (SizeT const   )4);
5439     bm_access_aligned_load(bm, a1 + 4UL, (SizeT const   )4);   5455     bm_access_aligned_load(bm, a1 + 4UL, (SizeT const   )4);
5440   } else {   5456   } else {
5441     vgDrd_bm_access_range(bm, a1, a1 + 8UL, (BmAccessTypeT const   )0);   5457     vgDrd_bm_access_range(bm, a1, a1 + 8UL, (BmAccessTypeT const   )0);
5442   }   5458   }
5443   return;   5459   return;
5444 }   5460 }
5445 }   5461 }
5446 void vgDrd_bm_access_range_store(struct bitmap * const  bm , Addr const   a1 ,   5462 void vgDrd_bm_access_range_store(struct bitmap * const  bm , Addr const   a1 ,
5447                                  Addr const   a2 )   5463                                  Addr const   a2 )
5448 {   5464 {
5449   Addr b ;   5465   Addr b ;
5450   Addr b_next ;   5466   Addr b_next ;
5451   long tmp ;   5467   long tmp ;
5452   long tmp___0 ;   5468   long tmp___0 ;
5453   Addr tmp___1 ;   5469   Addr tmp___1 ;
5454   int tmp___2 ;   5470   int tmp___2 ;
5455   long tmp___3 ;   5471   long tmp___3 ;
5456   Addr tmp___4 ;   5472   Addr tmp___4 ;
5457   int tmp___5 ;   5473   int tmp___5 ;
5458   long tmp___6 ;   5474   long tmp___6 ;
5459   Addr tmp___7 ;   5475   Addr tmp___7 ;
5460   int tmp___8 ;   5476   int tmp___8 ;
5461   long tmp___9 ;   5477   long tmp___9 ;
5462   Addr b_start ;   5478   Addr b_start ;
5463   Addr b_end ;   5479   Addr b_end ;
5464   struct bitmap2 *bm2 ;   5480   struct bitmap2 *bm2 ;
5465   UWord b0 ;   5481   UWord b0 ;
5466   UWord tmp___10 ;   5482   UWord tmp___10 ;
5467   long tmp___11 ;   5483   long tmp___11 ;
5468   Addr tmp___12 ;   5484   Addr tmp___12 ;
5469   Addr tmp___13 ;   5485   Addr tmp___13 ;
5470   Addr tmp___14 ;   5486   Addr tmp___14 ;
5471   int tmp___15 ;   5487   int tmp___15 ;
5472   long tmp___16 ;   5488   long tmp___16 ;
5473   UWord tmp___17 ;   5489   UWord tmp___17 ;
5474   UWord tmp___18 ;   5490   UWord tmp___18 ;
5475   int tmp___19 ;   5491   int tmp___19 ;
5476   long tmp___20 ;   5492   long tmp___20 ;
5477   UWord tmp___21 ;   5493   UWord tmp___21 ;
5478   UWord tmp___22 ;   5494   UWord tmp___22 ;
5479   int tmp___23 ;   5495   int tmp___23 ;
5480   long tmp___24 ;   5496   long tmp___24 ;
5481   unsigned int k ;   5497   unsigned int k ;
5482   UWord tmp___25 ;   5498   UWord tmp___25 ;
5483   UWord tmp___26 ;   5499   UWord tmp___26 ;
5484   UWord tmp___27 ;   5500   UWord tmp___27 ;
5485     5501  
5486   {   5502   {
5487   tmp = __builtin_expect((long )(! (! bm)), 1L);   5503   tmp = __builtin_expect((long )(! (! bm)), 1L);
5488   if (tmp) {   5504   if (tmp) {
5489     5505  
5490   } else {   5506   } else {
5491     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",   5507     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",
5492                         (Char const   *)"drd_bitmap.c", 242,   5508                         (Char const   *)"drd_bitmap.c", 242,
5493                         (Char const   *)"vgDrd_bm_access_range_store", "");   5509                         (Char const   *)"vgDrd_bm_access_range_store", "");
5494   }   5510   }
5495   tmp___0 = __builtin_expect((long )(! (! (a1 <= a2))), 1L);   5511   tmp___0 = __builtin_expect((long )(! (! (a1 <= a2))), 1L);
5496   if (tmp___0) {   5512   if (tmp___0) {
5497     5513  
5498   } else {   5514   } else {
5499     vgPlain_assert_fail((Bool )0, (Char const   *)"a1 <= a2",   5515     vgPlain_assert_fail((Bool )0, (Char const   *)"a1 <= a2",
5500                         (Char const   *)"drd_bitmap.c", 243,   5516                         (Char const   *)"drd_bitmap.c", 243,
5501                         (Char const   *)"vgDrd_bm_access_range_store", "");   5517                         (Char const   *)"vgDrd_bm_access_range_store", "");
5502   }   5518   }
5503   tmp___1 = first_address_with_higher_msb(a2);   5519   tmp___1 = first_address_with_higher_msb(a2);
5504   if (a2 < (Addr const   )tmp___1) {   5520   if (a2 < (Addr const   )tmp___1) {
5505     tmp___2 = 1;   5521     tmp___2 = 1;
5506   } else {   5522   } else {
5507     tmp___2 = 0;   5523     tmp___2 = 0;
5508   }   5524   }
5509   tmp___3 = __builtin_expect((long )tmp___2, 1L);   5525   tmp___3 = __builtin_expect((long )tmp___2, 1L);
5510   if (tmp___3) {   5526   if (tmp___3) {
5511     5527  
5512   } else {   5528   } else {
5513     vgPlain_assert_fail((Bool )0,   5529     vgPlain_assert_fail((Bool )0,
5514                         (Char const   *)"a2 < first_address_with_higher_msb(a2)",   5530                         (Char const   *)"a2 < first_address_with_higher_msb(a2)",
5515                         (Char const   *)"drd_bitmap.c", 244,   5531                         (Char const   *)"drd_bitmap.c", 244,
5516                         (Char const   *)"vgDrd_bm_access_range_store", "");   5532                         (Char const   *)"vgDrd_bm_access_range_store", "");
5517   }   5533   }
5518   tmp___4 = first_address_with_same_lsb(a1);   5534   tmp___4 = first_address_with_same_lsb(a1);
5519   if (a1 == (Addr const   )tmp___4) {   5535   if (a1 == (Addr const   )tmp___4) {
5520     tmp___5 = 1;   5536     tmp___5 = 1;
5521   } else {   5537   } else {
5522     tmp___5 = 0;   5538     tmp___5 = 0;
5523   }   5539   }
5524   tmp___6 = __builtin_expect((long )tmp___5, 1L);   5540   tmp___6 = __builtin_expect((long )tmp___5, 1L);
5525   if (tmp___6) {   5541   if (tmp___6) {
5526     5542  
5527   } else {   5543   } else {
5528     vgPlain_assert_fail((Bool )0,   5544     vgPlain_assert_fail((Bool )0,
5529                         (Char const   *)"a1 == first_address_with_same_lsb(a1)",   5545                         (Char const   *)"a1 == first_address_with_same_lsb(a1)",
5530                         (Char const   *)"drd_bitmap.c", 245,   5546                         (Char const   *)"drd_bitmap.c", 245,
5531                         (Char const   *)"vgDrd_bm_access_range_store", "");   5547                         (Char const   *)"vgDrd_bm_access_range_store", "");
5532   }   5548   }
5533   tmp___7 = first_address_with_same_lsb(a2);   5549   tmp___7 = first_address_with_same_lsb(a2);
5534   if (a2 == (Addr const   )tmp___7) {   5550   if (a2 == (Addr const   )tmp___7) {
5535     tmp___8 = 1;   5551     tmp___8 = 1;
5536   } else {   5552   } else {
5537     tmp___8 = 0;   5553     tmp___8 = 0;
5538   }   5554   }
5539   tmp___9 = __builtin_expect((long )tmp___8, 1L);   5555   tmp___9 = __builtin_expect((long )tmp___8, 1L);
5540   if (tmp___9) {   5556   if (tmp___9) {
5541     5557  
5542   } else {   5558   } else {
5543     vgPlain_assert_fail((Bool )0,   5559     vgPlain_assert_fail((Bool )0,
5544                         (Char const   *)"a2 == first_address_with_same_lsb(a2)",   5560                         (Char const   *)"a2 == first_address_with_same_lsb(a2)",
5545                         (Char const   *)"drd_bitmap.c", 246,   5561                         (Char const   *)"drd_bitmap.c", 246,
5546                         (Char const   *)"vgDrd_bm_access_range_store", "");   5562                         (Char const   *)"vgDrd_bm_access_range_store", "");
5547   }   5563   }
5548   b = (Addr )a1;   5564   b = (Addr )a1;
5549   while (b < (Addr )a2) {   5565   while (b < (Addr )a2) {
5550     b_next = first_address_with_higher_msb((Addr const   )b);   5566     b_next = first_address_with_higher_msb((Addr const   )b);
5551     if (b_next > (Addr )a2) {   5567     if (b_next > (Addr )a2) {
5552       b_next = (Addr )a2;   5568       b_next = (Addr )a2;
5553     } else {   5569     } else {
5554     5570  
5555     }   5571     }
5556     tmp___10 = address_msb((Addr const   )b);   5572     tmp___10 = address_msb((Addr const   )b);
5557     bm2 = bm2_lookup_or_insert_exclusive(bm, (UWord const   )tmp___10);   5573     bm2 = bm2_lookup_or_insert_exclusive(bm, (UWord const   )tmp___10);
5558     tmp___11 = __builtin_expect((long )(! (! bm2)), 1L);   5574     tmp___11 = __builtin_expect((long )(! (! bm2)), 1L);
5559     if (tmp___11) {   5575     if (tmp___11) {
5560     5576  
5561     } else {   5577     } else {
5562       vgPlain_assert_fail((Bool )0, (Char const   *)"bm2",   5578       vgPlain_assert_fail((Bool )0, (Char const   *)"bm2",
5563                           (Char const   *)"drd_bitmap.c", 262,   5579                           (Char const   *)"drd_bitmap.c", 262,
5564                           (Char const   *)"vgDrd_bm_access_range_store", "");   5580                           (Char const   *)"vgDrd_bm_access_range_store", "");
5565     }   5581     }
5566     tmp___13 = make_address((UWord const   )bm2->addr, (UWord const   )0);   5582     tmp___13 = make_address((UWord const   )bm2->addr, (UWord const   )0);
5567     if (tmp___13 < (Addr )a1) {   5583     if (tmp___13 < (Addr )a1) {
5568       b_start = (Addr )a1;   5584       b_start = (Addr )a1;
5569     } else {   5585     } else {
5570       tmp___12 = make_address((UWord const   )bm2->addr, (UWord const   )0);   5586       tmp___12 = make_address((UWord const   )bm2->addr, (UWord const   )0);
5571       if (tmp___12 < (Addr )a2) {   5587       if (tmp___12 < (Addr )a2) {
5572         b_start = make_address((UWord const   )bm2->addr, (UWord const   )0);   5588         b_start = make_address((UWord const   )bm2->addr, (UWord const   )0);
5573       } else {   5589       } else {
5574         break;   5590         break;
5575       }   5591       }
5576     }   5592     }
5577     tmp___14 = make_address((UWord const   )(bm2->addr + 1UL), (UWord const   )0);   5593     tmp___14 = make_address((UWord const   )(bm2->addr + 1UL), (UWord const   )0);
5578     if (tmp___14 < (Addr )a2) {   5594     if (tmp___14 < (Addr )a2) {
5579       b_end = make_address((UWord const   )(bm2->addr + 1UL), (UWord const   )0);   5595       b_end = make_address((UWord const   )(bm2->addr + 1UL), (UWord const   )0);
5580     } else {   5596     } else {
5581       b_end = (Addr )a2;   5597       b_end = (Addr )a2;
5582     }   5598     }
5583     if (a1 <= (Addr const   )b_start) {   5599     if (a1 <= (Addr const   )b_start) {
5584       if (b_start < b_end) {   5600       if (b_start < b_end) {
5585         if (b_end) {   5601         if (b_end) {
5586           if (b_end <= (Addr )a2) {   5602           if (b_end <= (Addr )a2) {
5587             tmp___15 = 1;   5603             tmp___15 = 1;
5588           } else {   5604           } else {
5589             tmp___15 = 0;   5605             tmp___15 = 0;
5590           }   5606           }
5591         } else {   5607         } else {
5592           tmp___15 = 0;   5608           tmp___15 = 0;
5593         }   5609         }
5594       } else {   5610       } else {
5595         tmp___15 = 0;   5611         tmp___15 = 0;
5596       }   5612       }
5597     } else {   5613     } else {
5598       tmp___15 = 0;   5614       tmp___15 = 0;
5599     }   5615     }
5600     tmp___16 = __builtin_expect((long )tmp___15, 1L);   5616     tmp___16 = __builtin_expect((long )tmp___15, 1L);
5601     if (tmp___16) {   5617     if (tmp___16) {
5602     5618  
5603     } else {   5619     } else {
5604       vgPlain_assert_fail((Bool )0,   5620       vgPlain_assert_fail((Bool )0,
5605                           (Char const   *)"a1 <= b_start && b_start < b_end && b_end && b_end <= a2",   5621                           (Char const   *)"a1 <= b_start && b_start < b_end && b_end && b_end <= a2",
5606                           (Char const   *)"drd_bitmap.c", 277,   5622                           (Char const   *)"drd_bitmap.c", 277,
5607                           (Char const   *)"vgDrd_bm_access_range_store", "");   5623                           (Char const   *)"vgDrd_bm_access_range_store", "");
5608     }   5624     }
5609     tmp___17 = address_msb((Addr const   )b_start);   5625     tmp___17 = address_msb((Addr const   )b_start);
5610     tmp___18 = address_msb((Addr const   )(b_end - 1UL));   5626     tmp___18 = address_msb((Addr const   )(b_end - 1UL));
5611     if (tmp___17 == tmp___18) {   5627     if (tmp___17 == tmp___18) {
5612       tmp___19 = 1;   5628       tmp___19 = 1;
5613     } else {   5629     } else {
5614       tmp___19 = 0;   5630       tmp___19 = 0;
5615     }   5631     }
5616     tmp___20 = __builtin_expect((long )tmp___19, 1L);   5632     tmp___20 = __builtin_expect((long )tmp___19, 1L);
5617     if (tmp___20) {   5633     if (tmp___20) {
5618     5634  
5619     } else {   5635     } else {
5620       vgPlain_assert_fail((Bool )0,   5636       vgPlain_assert_fail((Bool )0,
5621                           (Char const   *)"address_msb(b_start) == address_msb(b_end - 1)",   5637                           (Char const   *)"address_msb(b_start) == address_msb(b_end - 1)",
5622                           (Char const   *)"drd_bitmap.c", 278,   5638                           (Char const   *)"drd_bitmap.c", 278,
5623                           (Char const   *)"vgDrd_bm_access_range_store", "");   5639                           (Char const   *)"vgDrd_bm_access_range_store", "");
5624     }   5640     }
5625     tmp___21 = address_lsb((Addr const   )b_start);   5641     tmp___21 = address_lsb((Addr const   )b_start);
5626     tmp___22 = address_lsb((Addr const   )(b_end - 1UL));   5642     tmp___22 = address_lsb((Addr const   )(b_end - 1UL));
5627     if (tmp___21 <= tmp___22) {   5643     if (tmp___21 <= tmp___22) {
5628       tmp___23 = 1;   5644       tmp___23 = 1;
5629     } else {   5645     } else {
5630       tmp___23 = 0;   5646       tmp___23 = 0;
5631     }   5647     }
5632     tmp___24 = __builtin_expect((long )tmp___23, 1L);   5648     tmp___24 = __builtin_expect((long )tmp___23, 1L);
5633     if (tmp___24) {   5649     if (tmp___24) {
5634     5650  
5635     } else {   5651     } else {
5636       vgPlain_assert_fail((Bool )0,   5652       vgPlain_assert_fail((Bool )0,
5637                           (Char const   *)"address_lsb(b_start) <= address_lsb(b_end - 1)",   5653                           (Char const   *)"address_lsb(b_start) <= address_lsb(b_end - 1)",
5638                           (Char const   *)"drd_bitmap.c", 279,   5654                           (Char const   *)"drd_bitmap.c", 279,
5639                           (Char const   *)"vgDrd_bm_access_range_store", "");   5655                           (Char const   *)"vgDrd_bm_access_range_store", "");
5640     }   5656     }
5641     tmp___26 = address_lsb((Addr const   )b_start);   5657     tmp___26 = address_lsb((Addr const   )b_start);
5642     if (tmp___26 == 0UL) {   5658     if (tmp___26 == 0UL) {
5643       tmp___27 = address_lsb((Addr const   )b_end);   5659       tmp___27 = address_lsb((Addr const   )b_end);
5644       if (tmp___27 == 0UL) {   5660       if (tmp___27 == 0UL) {
5645         k = 0U;   5661         k = 0U;
5646         while (k < 1U << 7) {   5662         while (k < 1U << 7) {
5647           bm2->bm1.bm0_w[k] = ~ ((UWord )0);   5663           bm2->bm1.bm0_w[k] = ~ ((UWord )0);
5648           k ++;   5664           k ++;
5649         }   5665         }
5650       } else {   5666       } else {
5651         goto _L;   5667         goto _L;
5652       }   5668       }
5653     } else {   5669     } else {
5654       _L: /* CIL Label */   5670       _L: /* CIL Label */
5655       b0 = address_lsb((Addr const   )b_start);   5671       b0 = address_lsb((Addr const   )b_start);
5656       while (1) {   5672       while (1) {
5657         tmp___25 = address_lsb((Addr const   )(b_end - 1UL));   5673         tmp___25 = address_lsb((Addr const   )(b_end - 1UL));
5658         if (b0 <= tmp___25) {   5674         if (b0 <= tmp___25) {
5659     5675  
5660         } else {   5676         } else {
5661           break;   5677           break;
5662         }   5678         }
5663         bm0_set(bm2->bm1.bm0_w, (UWord const   )b0);   5679         bm0_set(bm2->bm1.bm0_w, (UWord const   )b0);
5664         b0 ++;   5680         b0 ++;
5665       }   5681       }
5666     }   5682     }
5667     b = b_next;   5683     b = b_next;
5668   }   5684   }
5669   return;   5685   return;
5670 }   5686 }
5671 }   5687 }
5672 void vgDrd_bm_access_store_1(struct bitmap * const  bm , Addr const   a1 )   5688 void vgDrd_bm_access_store_1(struct bitmap * const  bm , Addr const   a1 )
5673 {   5689 {
5674     5690  
5675     5691  
5676   {   5692   {
5677   bm_access_aligned_store(bm, a1, (SizeT const   )1);   5693   bm_access_aligned_store(bm, a1, (SizeT const   )1);
5678   return;   5694   return;
5679 }   5695 }
5680 }   5696 }
5681 void vgDrd_bm_access_store_2(struct bitmap * const  bm , Addr const   a1 )   5697 void vgDrd_bm_access_store_2(struct bitmap * const  bm , Addr const   a1 )
5682 {   5698 {
5683     5699  
5684     5700  
5685   {   5701   {
5686   if ((a1 & 1UL) == 0UL) {   5702   if ((a1 & 1UL) == 0UL) {
5687     bm_access_aligned_store(bm, a1, (SizeT const   )2);   5703     bm_access_aligned_store(bm, a1, (SizeT const   )2);
5688   } else {   5704   } else {
5689     vgDrd_bm_access_range(bm, a1, a1 + 2UL, (BmAccessTypeT const   )1);   5705     vgDrd_bm_access_range(bm, a1, a1 + 2UL, (BmAccessTypeT const   )1);
5690   }   5706   }
5691   return;   5707   return;
5692 }   5708 }
5693 }   5709 }
5694 void vgDrd_bm_access_store_4(struct bitmap * const  bm , Addr const   a1 )   5710 void vgDrd_bm_access_store_4(struct bitmap * const  bm , Addr const   a1 )
5695 {   5711 {
5696     5712  
5697     5713  
5698   {   5714   {
5699   if ((a1 & 3UL) == 0UL) {   5715   if ((a1 & 3UL) == 0UL) {
5700     bm_access_aligned_store(bm, a1, (SizeT const   )4);   5716     bm_access_aligned_store(bm, a1, (SizeT const   )4);
5701   } else {   5717   } else {
5702     vgDrd_bm_access_range(bm, a1, a1 + 4UL, (BmAccessTypeT const   )1);   5718     vgDrd_bm_access_range(bm, a1, a1 + 4UL, (BmAccessTypeT const   )1);
5703   }   5719   }
5704   return;   5720   return;
5705 }   5721 }
5706 }   5722 }
5707 void vgDrd_bm_access_store_8(struct bitmap * const  bm , Addr const   a1 )   5723 void vgDrd_bm_access_store_8(struct bitmap * const  bm , Addr const   a1 )
5708 {   5724 {
5709     5725  
5710     5726  
5711   {   5727   {
5712   if ((a1 & 7UL) == 0UL) {   5728   if ((a1 & 7UL) == 0UL) {
5713     bm_access_aligned_store(bm, a1, (SizeT const   )8);   5729     bm_access_aligned_store(bm, a1, (SizeT const   )8);
5714   } else   5730   } else
5715   if ((a1 & 3UL) == 0UL) {   5731   if ((a1 & 3UL) == 0UL) {
5716     bm_access_aligned_store(bm, a1, (SizeT const   )4);   5732     bm_access_aligned_store(bm, a1, (SizeT const   )4);
5717     bm_access_aligned_store(bm, a1 + 4UL, (SizeT const   )4);   5733     bm_access_aligned_store(bm, a1 + 4UL, (SizeT const   )4);
5718   } else {   5734   } else {
5719     vgDrd_bm_access_range(bm, a1, a1 + 8UL, (BmAccessTypeT const   )1);   5735     vgDrd_bm_access_range(bm, a1, a1 + 8UL, (BmAccessTypeT const   )1);
5720   }   5736   }
5721   return;   5737   return;
5722 }   5738 }
5723 }   5739 }
5724 Bool vgDrd_bm_has(struct bitmap * const  bm , Addr const   a1 ,   5740 Bool vgDrd_bm_has(struct bitmap * const  bm , Addr const   a1 ,
5725                   Addr const   a2 , BmAccessTypeT const   access_type )   5741                   Addr const   a2 , BmAccessTypeT const   access_type )
5726 {   5742 {
5727   int tmp ;   5743   int tmp ;
5728   long tmp___0 ;   5744   long tmp___0 ;
5729   Bool tmp___1 ;   5745   Bool tmp___1 ;
5730   Bool tmp___2 ;   5746   Bool tmp___2 ;
5731     5747  
5732   {   5748   {
5733   if ((unsigned int const   )access_type == 0U) {   5749   if ((unsigned int const   )access_type == 0U) {
5734     tmp = 1;   5750     tmp = 1;
5735   } else   5751   } else
5736   if ((unsigned int const   )access_type == 1U) {   5752   if ((unsigned int const   )access_type == 1U) {
5737     tmp = 1;   5753     tmp = 1;
5738   } else {   5754   } else {
5739     tmp = 0;   5755     tmp = 0;
5740   }   5756   }
5741   tmp___0 = __builtin_expect((long )tmp, 1L);   5757   tmp___0 = __builtin_expect((long )tmp, 1L);
5742   if (tmp___0) {   5758   if (tmp___0) {
5743     5759  
5744   } else {   5760   } else {
5745     vgPlain_assert_fail((Bool )0,   5761     vgPlain_assert_fail((Bool )0,
5746                         (Char const   *)"access_type == eLoad || access_type == eStore",   5762                         (Char const   *)"access_type == eLoad || access_type == eStore",
5747                         (Char const   *)"drd_bitmap.c", 337,   5763                         (Char const   *)"drd_bitmap.c", 337,
5748                         (Char const   *)"vgDrd_bm_has", "");   5764                         (Char const   *)"vgDrd_bm_has", "");
5749   }   5765   }
5750   if ((unsigned int const   )access_type == 0U) {   5766   if ((unsigned int const   )access_type == 0U) {
5751     tmp___1 = vgDrd_bm_has_any_load(bm, a1, a2);   5767     tmp___1 = vgDrd_bm_has_any_load(bm, a1, a2);
5752     return (tmp___1);   5768     return (tmp___1);
5753   } else {   5769   } else {
5754     tmp___2 = vgDrd_bm_has_any_store(bm, a1, a2);   5770     tmp___2 = vgDrd_bm_has_any_store(bm, a1, a2);
5755     return (tmp___2);   5771     return (tmp___2);
5756   }   5772   }
5757 }   5773 }
5758 }   5774 }
5759 Bool vgDrd_bm_has_any_load_g(struct bitmap * const  bm )   5775 Bool vgDrd_bm_has_any_load_g(struct bitmap * const  bm )
5760 {   5776 {
5761   struct bitmap2 *bm2 ;   5777   struct bitmap2 *bm2 ;
5762   long tmp ;   5778   long tmp ;
5763   Addr b_start ;   5779   Addr b_start ;
5764   Addr b_end ;   5780   Addr b_end ;
5765   UWord b0 ;   5781   UWord b0 ;
5766   struct bitmap1  const  *p1 ;   5782   struct bitmap1  const  *p1 ;
5767   UWord tmp___0 ;   5783   UWord tmp___0 ;
5768   UWord tmp___1 ;   5784   UWord tmp___1 ;
5769   void *tmp___2 ;   5785   void *tmp___2 ;
5770     5786  
5771   {   5787   {
5772   tmp = __builtin_expect((long )(! (! bm)), 1L);   5788   tmp = __builtin_expect((long )(! (! bm)), 1L);
5773   if (tmp) {   5789   if (tmp) {
5774     5790  
5775   } else {   5791   } else {
5776     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",   5792     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",
5777                         (Char const   *)"drd_bitmap.c", 349,   5793                         (Char const   *)"drd_bitmap.c", 349,
5778                         (Char const   *)"vgDrd_bm_has_any_load_g", "");   5794                         (Char const   *)"vgDrd_bm_has_any_load_g", "");
5779   }   5795   }
5780   vgPlain_OSetGen_ResetIter(bm->oset);   5796   vgPlain_OSetGen_ResetIter(bm->oset);
5781   while (1) {   5797   while (1) {
5782     tmp___2 = vgPlain_OSetGen_Next(bm->oset);   5798     tmp___2 = vgPlain_OSetGen_Next(bm->oset);
5783     bm2 = (struct bitmap2 *)tmp___2;   5799     bm2 = (struct bitmap2 *)tmp___2;
5784     if ((unsigned int )bm2 != (unsigned int )((void *)0)) {   5800     if ((unsigned int )bm2 != (unsigned int )((void *)0)) {
5785     5801  
5786     } else {   5802     } else {
5787       break;   5803       break;
5788     }   5804     }
5789     p1 = (struct bitmap1  const  *)(& bm2->bm1);   5805     p1 = (struct bitmap1  const  *)(& bm2->bm1);
5790     b_start = make_address((UWord const   )bm2->addr, (UWord const   )0);   5806     b_start = make_address((UWord const   )bm2->addr, (UWord const   )0);
5791     b_end = make_address((UWord const   )(bm2->addr + 1UL), (UWord const   )0);   5807     b_end = make_address((UWord const   )(bm2->addr + 1UL), (UWord const   )0);
5792     b0 = address_lsb((Addr const   )b_start);   5808     b0 = address_lsb((Addr const   )b_start);
5793     while (1) {   5809     while (1) {
5794       tmp___1 = address_lsb((Addr const   )(b_end - 1UL));   5810       tmp___1 = address_lsb((Addr const   )(b_end - 1UL));
5795       if (b0 <= tmp___1) {   5811       if (b0 <= tmp___1) {
5796     5812  
5797       } else {   5813       } else {
5798         break;   5814         break;
5799       }   5815       }
5800       tmp___0 = bm0_is_set((UWord const   *)(p1->bm0_r), (UWord const   )b0);   5816       tmp___0 = bm0_is_set((UWord const   *)(p1->bm0_r), (UWord const   )b0);
5801       if (tmp___0) {   5817       if (tmp___0) {
5802         return ((Bool )1);   5818         return ((Bool )1);
5803       } else {   5819       } else {
5804     5820  
5805       }   5821       }
5806       b0 ++;   5822       b0 ++;
5807     }   5823     }
5808   }   5824   }
5809   return ((Bool )0);   5825   return ((Bool )0);
5810 }   5826 }
5811 }   5827 }
5812 Bool vgDrd_bm_has_any_load(struct bitmap * const  bm , Addr const   a1 ,   5828 Bool vgDrd_bm_has_any_load(struct bitmap * const  bm , Addr const   a1 ,
5813                            Addr const   a2 )   5829                            Addr const   a2 )
5814 {   5830 {
5815   Addr b ;   5831   Addr b ;
5816   Addr b_next ;   5832   Addr b_next ;
5817   long tmp ;   5833   long tmp ;
5818   struct bitmap2  const  *bm2 ;   5834   struct bitmap2  const  *bm2 ;
5819   UWord tmp___0 ;   5835   UWord tmp___0 ;
5820   struct bitmap2  const  *tmp___1 ;   5836   struct bitmap2  const  *tmp___1 ;
5821   Addr b_start ;   5837   Addr b_start ;
5822   Addr b_end ;   5838   Addr b_end ;
5823   UWord b0 ;   5839   UWord b0 ;
5824   struct bitmap1  const  *p1 ;   5840   struct bitmap1  const  *p1 ;
5825   Addr tmp___2 ;   5841   Addr tmp___2 ;
5826   Addr tmp___3 ;   5842   Addr tmp___3 ;
5827   int tmp___4 ;   5843   int tmp___4 ;
5828   long tmp___5 ;   5844   long tmp___5 ;
5829   Addr tmp___6 ;   5845   Addr tmp___6 ;
5830   int tmp___7 ;   5846   int tmp___7 ;
5831   long tmp___8 ;   5847   long tmp___8 ;
5832   long tmp___9 ;   5848   long tmp___9 ;
5833   UWord tmp___10 ;   5849   UWord tmp___10 ;
5834   UWord tmp___11 ;   5850   UWord tmp___11 ;
5835   int tmp___12 ;   5851   int tmp___12 ;
5836   long tmp___13 ;   5852   long tmp___13 ;
5837   UWord tmp___14 ;   5853   UWord tmp___14 ;
5838   UWord tmp___15 ;   5854   UWord tmp___15 ;
5839     5855  
5840   {   5856   {
5841   tmp = __builtin_expect((long )(! (! bm)), 1L);   5857   tmp = __builtin_expect((long )(! (! bm)), 1L);
5842   if (tmp) {   5858   if (tmp) {
5843     5859  
5844   } else {   5860   } else {
5845     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",   5861     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",
5846                         (Char const   *)"drd_bitmap.c", 373,   5862                         (Char const   *)"drd_bitmap.c", 373,
5847                         (Char const   *)"vgDrd_bm_has_any_load", "");   5863                         (Char const   *)"vgDrd_bm_has_any_load", "");
5848   }   5864   }
5849   b = (Addr )a1;   5865   b = (Addr )a1;
5850   while (b < (Addr )a2) {   5866   while (b < (Addr )a2) {
5851     tmp___0 = address_msb((Addr const   )b);   5867     tmp___0 = address_msb((Addr const   )b);
5852     tmp___1 = bm2_lookup(bm, (UWord const   )tmp___0);   5868     tmp___1 = bm2_lookup(bm, (UWord const   )tmp___0);
5853     bm2 = tmp___1;   5869     bm2 = tmp___1;
5854     b_next = first_address_with_higher_msb((Addr const   )b);   5870     b_next = first_address_with_higher_msb((Addr const   )b);
5855     if (b_next > (Addr )a2) {   5871     if (b_next > (Addr )a2) {
5856       b_next = (Addr )a2;   5872       b_next = (Addr )a2;
5857     } else {   5873     } else {
5858     5874  
5859     }   5875     }
5860     if (bm2) {   5876     if (bm2) {
5861       p1 = & bm2->bm1;   5877       p1 = & bm2->bm1;
5862       tmp___3 = make_address(bm2->addr, (UWord const   )0);   5878       tmp___3 = make_address(bm2->addr, (UWord const   )0);
5863       if (tmp___3 < (Addr )a1) {   5879       if (tmp___3 < (Addr )a1) {
5864         b_start = (Addr )a1;   5880         b_start = (Addr )a1;
5865       } else {   5881       } else {
5866         tmp___2 = make_address(bm2->addr, (UWord const   )0);   5882         tmp___2 = make_address(bm2->addr, (UWord const   )0);
5867         if (tmp___2 < (Addr )a2) {   5883         if (tmp___2 < (Addr )a2) {
5868           b_start = make_address(bm2->addr, (UWord const   )0);   5884           b_start = make_address(bm2->addr, (UWord const   )0);
5869         } else {   5885         } else {
5870           break;   5886           break;
5871         }   5887         }
5872       }   5888       }
5873       if (a1 <= (Addr const   )b_start) {   5889       if (a1 <= (Addr const   )b_start) {
5874         if (b_start <= (Addr )a2) {   5890         if (b_start <= (Addr )a2) {
5875           tmp___4 = 1;   5891           tmp___4 = 1;
5876         } else {   5892         } else {
5877           tmp___4 = 0;   5893           tmp___4 = 0;
5878         }   5894         }
5879       } else {   5895       } else {
5880         tmp___4 = 0;   5896         tmp___4 = 0;
5881       }   5897       }
5882       tmp___5 = __builtin_expect((long )tmp___4, 1L);   5898       tmp___5 = __builtin_expect((long )tmp___4, 1L);
5883       if (tmp___5) {   5899       if (tmp___5) {
5884     5900  
5885       } else {   5901       } else {
5886         vgPlain_assert_fail((Bool )0,   5902         vgPlain_assert_fail((Bool )0,
5887                             (Char const   *)"a1 <= b_start && b_start <= a2",   5903                             (Char const   *)"a1 <= b_start && b_start <= a2",
5888                             (Char const   *)"drd_bitmap.c", 399,   5904                             (Char const   *)"drd_bitmap.c", 399,
5889                             (Char const   *)"vgDrd_bm_has_any_load", "");   5905                             (Char const   *)"vgDrd_bm_has_any_load", "");
5890       }   5906       }
5891       tmp___6 = make_address(bm2->addr + 1UL, (UWord const   )0);   5907       tmp___6 = make_address(bm2->addr + 1UL, (UWord const   )0);
5892       if (tmp___6 < (Addr )a2) {   5908       if (tmp___6 < (Addr )a2) {
5893         b_end = make_address(bm2->addr + 1UL, (UWord const   )0);   5909         b_end = make_address(bm2->addr + 1UL, (UWord const   )0);
5894       } else {   5910       } else {
5895         b_end = (Addr )a2;   5911         b_end = (Addr )a2;
5896       }   5912       }
5897       if (a1 <= (Addr const   )b_end) {   5913       if (a1 <= (Addr const   )b_end) {
5898         if (b_end <= (Addr )a2) {   5914         if (b_end <= (Addr )a2) {
5899           tmp___7 = 1;   5915           tmp___7 = 1;
5900         } else {   5916         } else {
5901           tmp___7 = 0;   5917           tmp___7 = 0;
5902         }   5918         }
5903       } else {   5919       } else {
5904         tmp___7 = 0;   5920         tmp___7 = 0;
5905       }   5921       }
5906       tmp___8 = __builtin_expect((long )tmp___7, 1L);   5922       tmp___8 = __builtin_expect((long )tmp___7, 1L);
5907       if (tmp___8) {   5923       if (tmp___8) {
5908     5924  
5909       } else {   5925       } else {
5910         vgPlain_assert_fail((Bool )0,   5926         vgPlain_assert_fail((Bool )0,
5911                             (Char const   *)"a1 <= b_end && b_end <= a2",   5927                             (Char const   *)"a1 <= b_end && b_end <= a2",
5912                             (Char const   *)"drd_bitmap.c", 405,   5928                             (Char const   *)"drd_bitmap.c", 405,
5913                             (Char const   *)"vgDrd_bm_has_any_load", "");   5929                             (Char const   *)"vgDrd_bm_has_any_load", "");
5914       }   5930       }
5915       tmp___9 = __builtin_expect((long )(! (! (b_start < b_end))), 1L);   5931       tmp___9 = __builtin_expect((long )(! (! (b_start < b_end))), 1L);
5916       if (tmp___9) {   5932       if (tmp___9) {
5917     5933  
5918       } else {   5934       } else {
5919         vgPlain_assert_fail((Bool )0, (Char const   *)"b_start < b_end",   5935         vgPlain_assert_fail((Bool )0, (Char const   *)"b_start < b_end",
5920                             (Char const   *)"drd_bitmap.c", 406,   5936                             (Char const   *)"drd_bitmap.c", 406,
5921                             (Char const   *)"vgDrd_bm_has_any_load", "");   5937                             (Char const   *)"vgDrd_bm_has_any_load", "");
5922       }   5938       }
5923       tmp___10 = address_lsb((Addr const   )b_start);   5939       tmp___10 = address_lsb((Addr const   )b_start);
5924       tmp___11 = address_lsb((Addr const   )(b_end - 1UL));   5940       tmp___11 = address_lsb((Addr const   )(b_end - 1UL));
5925       if (tmp___10 <= tmp___11) {   5941       if (tmp___10 <= tmp___11) {
5926         tmp___12 = 1;   5942         tmp___12 = 1;
5927       } else {   5943       } else {
5928         tmp___12 = 0;   5944         tmp___12 = 0;
5929       }   5945       }
5930       tmp___13 = __builtin_expect((long )tmp___12, 1L);   5946       tmp___13 = __builtin_expect((long )tmp___12, 1L);
5931       if (tmp___13) {   5947       if (tmp___13) {
5932     5948  
5933       } else {   5949       } else {
5934         vgPlain_assert_fail((Bool )0,   5950         vgPlain_assert_fail((Bool )0,
5935                             (Char const   *)"address_lsb(b_start) <= address_lsb(b_end - 1)",   5951                             (Char const   *)"address_lsb(b_start) <= address_lsb(b_end - 1)",
5936                             (Char const   *)"drd_bitmap.c", 407,   5952                             (Char const   *)"drd_bitmap.c", 407,
5937                             (Char const   *)"vgDrd_bm_has_any_load", "");   5953                             (Char const   *)"vgDrd_bm_has_any_load", "");
5938       }   5954       }
5939       b0 = address_lsb((Addr const   )b_start);   5955       b0 = address_lsb((Addr const   )b_start);
5940       while (1) {   5956       while (1) {
5941         tmp___15 = address_lsb((Addr const   )(b_end - 1UL));   5957         tmp___15 = address_lsb((Addr const   )(b_end - 1UL));
5942         if (b0 <= tmp___15) {   5958         if (b0 <= tmp___15) {
5943     5959  
5944         } else {   5960         } else {
5945           break;   5961           break;
5946         }   5962         }
5947         tmp___14 = bm0_is_set((UWord const   *)(p1->bm0_r), (UWord const   )b0);   5963         tmp___14 = bm0_is_set((UWord const   *)(p1->bm0_r), (UWord const   )b0);
5948         if (tmp___14) {   5964         if (tmp___14) {
5949           return ((Bool )1);   5965           return ((Bool )1);
5950         } else {   5966         } else {
5951     5967  
5952         }   5968         }
5953         b0 ++;   5969         b0 ++;
5954       }   5970       }
5955     } else {   5971     } else {
5956     5972  
5957     }   5973     }
5958     b = b_next;   5974     b = b_next;
5959   }   5975   }
5960   return ((Bool )0);   5976   return ((Bool )0);
5961 }   5977 }
5962 }   5978 }
5963 Bool vgDrd_bm_has_any_store(struct bitmap * const  bm , Addr const   a1 ,   5979 Bool vgDrd_bm_has_any_store(struct bitmap * const  bm , Addr const   a1 ,
5964                             Addr const   a2 )   5980                             Addr const   a2 )
5965 {   5981 {
5966   Addr b ;   5982   Addr b ;
5967   Addr b_next ;   5983   Addr b_next ;
5968   long tmp ;   5984   long tmp ;
5969   struct bitmap2  const  *bm2 ;   5985   struct bitmap2  const  *bm2 ;
5970   UWord tmp___0 ;   5986   UWord tmp___0 ;
5971   struct bitmap2  const  *tmp___1 ;   5987   struct bitmap2  const  *tmp___1 ;
5972   Addr b_start ;   5988   Addr b_start ;
5973   Addr b_end ;   5989   Addr b_end ;
5974   UWord b0 ;   5990   UWord b0 ;
5975   struct bitmap1  const  *p1 ;   5991   struct bitmap1  const  *p1 ;
5976   Addr tmp___2 ;   5992   Addr tmp___2 ;
5977   Addr tmp___3 ;   5993   Addr tmp___3 ;
5978   int tmp___4 ;   5994   int tmp___4 ;
5979   long tmp___5 ;   5995   long tmp___5 ;
5980   Addr tmp___6 ;   5996   Addr tmp___6 ;
5981   int tmp___7 ;   5997   int tmp___7 ;
5982   long tmp___8 ;   5998   long tmp___8 ;
5983   long tmp___9 ;   5999   long tmp___9 ;
5984   UWord tmp___10 ;   6000   UWord tmp___10 ;
5985   UWord tmp___11 ;   6001   UWord tmp___11 ;
5986   int tmp___12 ;   6002   int tmp___12 ;
5987   long tmp___13 ;   6003   long tmp___13 ;
5988   UWord tmp___14 ;   6004   UWord tmp___14 ;
5989   UWord tmp___15 ;   6005   UWord tmp___15 ;
5990     6006  
5991   {   6007   {
5992   tmp = __builtin_expect((long )(! (! bm)), 1L);   6008   tmp = __builtin_expect((long )(! (! bm)), 1L);
5993   if (tmp) {   6009   if (tmp) {
5994     6010  
5995   } else {   6011   } else {
5996     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",   6012     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",
5997                         (Char const   *)"drd_bitmap.c", 426,   6013                         (Char const   *)"drd_bitmap.c", 426,
5998                         (Char const   *)"vgDrd_bm_has_any_store", "");   6014                         (Char const   *)"vgDrd_bm_has_any_store", "");
5999   }   6015   }
6000   b = (Addr )a1;   6016   b = (Addr )a1;
6001   while (b < (Addr )a2) {   6017   while (b < (Addr )a2) {
6002     tmp___0 = address_msb((Addr const   )b);   6018     tmp___0 = address_msb((Addr const   )b);
6003     tmp___1 = bm2_lookup(bm, (UWord const   )tmp___0);   6019     tmp___1 = bm2_lookup(bm, (UWord const   )tmp___0);
6004     bm2 = tmp___1;   6020     bm2 = tmp___1;
6005     b_next = first_address_with_higher_msb((Addr const   )b);   6021     b_next = first_address_with_higher_msb((Addr const   )b);
6006     if (b_next > (Addr )a2) {   6022     if (b_next > (Addr )a2) {
6007       b_next = (Addr )a2;   6023       b_next = (Addr )a2;
6008     } else {   6024     } else {
6009     6025  
6010     }   6026     }
6011     if (bm2) {   6027     if (bm2) {
6012       p1 = & bm2->bm1;   6028       p1 = & bm2->bm1;
6013       tmp___3 = make_address(bm2->addr, (UWord const   )0);   6029       tmp___3 = make_address(bm2->addr, (UWord const   )0);
6014       if (tmp___3 < (Addr )a1) {   6030       if (tmp___3 < (Addr )a1) {
6015         b_start = (Addr )a1;   6031         b_start = (Addr )a1;
6016       } else {   6032       } else {
6017         tmp___2 = make_address(bm2->addr, (UWord const   )0);   6033         tmp___2 = make_address(bm2->addr, (UWord const   )0);
6018         if (tmp___2 < (Addr )a2) {   6034         if (tmp___2 < (Addr )a2) {
6019           b_start = make_address(bm2->addr, (UWord const   )0);   6035           b_start = make_address(bm2->addr, (UWord const   )0);
6020         } else {   6036         } else {
6021           break;   6037           break;
6022         }   6038         }
6023       }   6039       }
6024       if (a1 <= (Addr const   )b_start) {   6040       if (a1 <= (Addr const   )b_start) {
6025         if (b_start <= (Addr )a2) {   6041         if (b_start <= (Addr )a2) {
6026           tmp___4 = 1;   6042           tmp___4 = 1;
6027         } else {   6043         } else {
6028           tmp___4 = 0;   6044           tmp___4 = 0;
6029         }   6045         }
6030       } else {   6046       } else {
6031         tmp___4 = 0;   6047         tmp___4 = 0;
6032       }   6048       }
6033       tmp___5 = __builtin_expect((long )tmp___4, 1L);   6049       tmp___5 = __builtin_expect((long )tmp___4, 1L);
6034       if (tmp___5) {   6050       if (tmp___5) {
6035     6051  
6036       } else {   6052       } else {
6037         vgPlain_assert_fail((Bool )0,   6053         vgPlain_assert_fail((Bool )0,
6038                             (Char const   *)"a1 <= b_start && b_start <= a2",   6054                             (Char const   *)"a1 <= b_start && b_start <= a2",
6039                             (Char const   *)"drd_bitmap.c", 452,   6055                             (Char const   *)"drd_bitmap.c", 452,
6040                             (Char const   *)"vgDrd_bm_has_any_store", "");   6056                             (Char const   *)"vgDrd_bm_has_any_store", "");
6041       }   6057       }
6042       tmp___6 = make_address(bm2->addr + 1UL, (UWord const   )0);   6058       tmp___6 = make_address(bm2->addr + 1UL, (UWord const   )0);
6043       if (tmp___6 < (Addr )a2) {   6059       if (tmp___6 < (Addr )a2) {
6044         b_end = make_address(bm2->addr + 1UL, (UWord const   )0);   6060         b_end = make_address(bm2->addr + 1UL, (UWord const   )0);
6045       } else {   6061       } else {
6046         b_end = (Addr )a2;   6062         b_end = (Addr )a2;
6047       }   6063       }
6048       if (a1 <= (Addr const   )b_end) {   6064       if (a1 <= (Addr const   )b_end) {
6049         if (b_end <= (Addr )a2) {   6065         if (b_end <= (Addr )a2) {
6050           tmp___7 = 1;   6066           tmp___7 = 1;
6051         } else {   6067         } else {
6052           tmp___7 = 0;   6068           tmp___7 = 0;
6053         }   6069         }
6054       } else {   6070       } else {
6055         tmp___7 = 0;   6071         tmp___7 = 0;
6056       }   6072       }
6057       tmp___8 = __builtin_expect((long )tmp___7, 1L);   6073       tmp___8 = __builtin_expect((long )tmp___7, 1L);
6058       if (tmp___8) {   6074       if (tmp___8) {
6059     6075  
6060       } else {   6076       } else {
6061         vgPlain_assert_fail((Bool )0,   6077         vgPlain_assert_fail((Bool )0,
6062                             (Char const   *)"a1 <= b_end && b_end <= a2",   6078                             (Char const   *)"a1 <= b_end && b_end <= a2",
6063                             (Char const   *)"drd_bitmap.c", 458,   6079                             (Char const   *)"drd_bitmap.c", 458,
6064                             (Char const   *)"vgDrd_bm_has_any_store", "");   6080                             (Char const   *)"vgDrd_bm_has_any_store", "");
6065       }   6081       }
6066       tmp___9 = __builtin_expect((long )(! (! (b_start < b_end))), 1L);   6082       tmp___9 = __builtin_expect((long )(! (! (b_start < b_end))), 1L);
6067       if (tmp___9) {   6083       if (tmp___9) {
6068     6084  
6069       } else {   6085       } else {
6070         vgPlain_assert_fail((Bool )0, (Char const   *)"b_start < b_end",   6086         vgPlain_assert_fail((Bool )0, (Char const   *)"b_start < b_end",
6071                             (Char const   *)"drd_bitmap.c", 459,   6087                             (Char const   *)"drd_bitmap.c", 459,
6072                             (Char const   *)"vgDrd_bm_has_any_store", "");   6088                             (Char const   *)"vgDrd_bm_has_any_store", "");
6073       }   6089       }
6074       tmp___10 = address_lsb((Addr const   )b_start);   6090       tmp___10 = address_lsb((Addr const   )b_start);
6075       tmp___11 = address_lsb((Addr const   )(b_end - 1UL));   6091       tmp___11 = address_lsb((Addr const   )(b_end - 1UL));
6076       if (tmp___10 <= tmp___11) {   6092       if (tmp___10 <= tmp___11) {
6077         tmp___12 = 1;   6093         tmp___12 = 1;
6078       } else {   6094       } else {
6079         tmp___12 = 0;   6095         tmp___12 = 0;
6080       }   6096       }
6081       tmp___13 = __builtin_expect((long )tmp___12, 1L);   6097       tmp___13 = __builtin_expect((long )tmp___12, 1L);
6082       if (tmp___13) {   6098       if (tmp___13) {
6083     6099  
6084       } else {   6100       } else {
6085         vgPlain_assert_fail((Bool )0,   6101         vgPlain_assert_fail((Bool )0,
6086                             (Char const   *)"address_lsb(b_start) <= address_lsb(b_end - 1)",   6102                             (Char const   *)"address_lsb(b_start) <= address_lsb(b_end - 1)",
6087                             (Char const   *)"drd_bitmap.c", 460,   6103                             (Char const   *)"drd_bitmap.c", 460,
6088                             (Char const   *)"vgDrd_bm_has_any_store", "");   6104                             (Char const   *)"vgDrd_bm_has_any_store", "");
6089       }   6105       }
6090       b0 = address_lsb((Addr const   )b_start);   6106       b0 = address_lsb((Addr const   )b_start);
6091       while (1) {   6107       while (1) {
6092         tmp___15 = address_lsb((Addr const   )(b_end - 1UL));   6108         tmp___15 = address_lsb((Addr const   )(b_end - 1UL));
6093         if (b0 <= tmp___15) {   6109         if (b0 <= tmp___15) {
6094     6110  
6095         } else {   6111         } else {
6096           break;   6112           break;
6097         }   6113         }
6098         tmp___14 = bm0_is_set((UWord const   *)(p1->bm0_w), (UWord const   )b0);   6114         tmp___14 = bm0_is_set((UWord const   *)(p1->bm0_w), (UWord const   )b0);
6099         if (tmp___14) {   6115         if (tmp___14) {
6100           return ((Bool )1);   6116           return ((Bool )1);
6101         } else {   6117         } else {
6102     6118  
6103         }   6119         }
6104         b0 ++;   6120         b0 ++;
6105       }   6121       }
6106     } else {   6122     } else {
6107     6123  
6108     }   6124     }
6109     b = b_next;   6125     b = b_next;
6110   }   6126   }
6111   return ((Bool )0);   6127   return ((Bool )0);
6112 }   6128 }
6113 }   6129 }
6114 Bool vgDrd_bm_has_any_access(struct bitmap * const  bm , Addr const   a1 ,   6130 Bool vgDrd_bm_has_any_access(struct bitmap * const  bm , Addr const   a1 ,
6115                              Addr const   a2 )   6131                              Addr const   a2 )
6116 {   6132 {
6117   Addr b ;   6133   Addr b ;
6118   Addr b_next ;   6134   Addr b_next ;
6119   long tmp ;   6135   long tmp ;
6120   struct bitmap2  const  *bm2 ;   6136   struct bitmap2  const  *bm2 ;
6121   UWord tmp___0 ;   6137   UWord tmp___0 ;
6122   struct bitmap2  const  *tmp___1 ;   6138   struct bitmap2  const  *tmp___1 ;
6123   Addr b_start ;   6139   Addr b_start ;
6124   Addr b_end ;   6140   Addr b_end ;
6125   UWord b0 ;   6141   UWord b0 ;
6126   struct bitmap1  const  *p1 ;   6142   struct bitmap1  const  *p1 ;
6127   Addr tmp___2 ;   6143   Addr tmp___2 ;
6128   Addr tmp___3 ;   6144   Addr tmp___3 ;
6129   int tmp___4 ;   6145   int tmp___4 ;
6130   long tmp___5 ;   6146   long tmp___5 ;
6131   Addr tmp___6 ;   6147   Addr tmp___6 ;
6132   int tmp___7 ;   6148   int tmp___7 ;
6133   long tmp___8 ;   6149   long tmp___8 ;
6134   long tmp___9 ;   6150   long tmp___9 ;
6135   UWord tmp___10 ;   6151   UWord tmp___10 ;
6136   UWord tmp___11 ;   6152   UWord tmp___11 ;
6137   int tmp___12 ;   6153   int tmp___12 ;
6138   long tmp___13 ;   6154   long tmp___13 ;
6139   UWord tmp___14 ;   6155   UWord tmp___14 ;
6140   UWord tmp___15 ;   6156   UWord tmp___15 ;
6141   UWord tmp___16 ;   6157   UWord tmp___16 ;
6142     6158  
6143   {   6159   {
6144   tmp = __builtin_expect((long )(! (! bm)), 1L);   6160   tmp = __builtin_expect((long )(! (! bm)), 1L);
6145   if (tmp) {   6161   if (tmp) {
6146     6162  
6147   } else {   6163   } else {
6148     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",   6164     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",
6149                         (Char const   *)"drd_bitmap.c", 481,   6165                         (Char const   *)"drd_bitmap.c", 481,
6150                         (Char const   *)"vgDrd_bm_has_any_access", "");   6166                         (Char const   *)"vgDrd_bm_has_any_access", "");
6151   }   6167   }
6152   b = (Addr )a1;   6168   b = (Addr )a1;
6153   while (b < (Addr )a2) {   6169   while (b < (Addr )a2) {
6154     tmp___0 = address_msb((Addr const   )b);   6170     tmp___0 = address_msb((Addr const   )b);
6155     tmp___1 = bm2_lookup(bm, (UWord const   )tmp___0);   6171     tmp___1 = bm2_lookup(bm, (UWord const   )tmp___0);
6156     bm2 = tmp___1;   6172     bm2 = tmp___1;
6157     b_next = first_address_with_higher_msb((Addr const   )b);   6173     b_next = first_address_with_higher_msb((Addr const   )b);
6158     if (b_next > (Addr )a2) {   6174     if (b_next > (Addr )a2) {
6159       b_next = (Addr )a2;   6175       b_next = (Addr )a2;
6160     } else {   6176     } else {
6161     6177  
6162     }   6178     }
6163     if (bm2) {   6179     if (bm2) {
6164       p1 = & bm2->bm1;   6180       p1 = & bm2->bm1;
6165       tmp___3 = make_address(bm2->addr, (UWord const   )0);   6181       tmp___3 = make_address(bm2->addr, (UWord const   )0);
6166       if (tmp___3 < (Addr )a1) {   6182       if (tmp___3 < (Addr )a1) {
6167         b_start = (Addr )a1;   6183         b_start = (Addr )a1;
6168       } else {   6184       } else {
6169         tmp___2 = make_address(bm2->addr, (UWord const   )0);   6185         tmp___2 = make_address(bm2->addr, (UWord const   )0);
6170         if (tmp___2 < (Addr )a2) {   6186         if (tmp___2 < (Addr )a2) {
6171           b_start = make_address(bm2->addr, (UWord const   )0);   6187           b_start = make_address(bm2->addr, (UWord const   )0);
6172         } else {   6188         } else {
6173           break;   6189           break;
6174         }   6190         }
6175       }   6191       }
6176       if (a1 <= (Addr const   )b_start) {   6192       if (a1 <= (Addr const   )b_start) {
6177         if (b_start <= (Addr )a2) {   6193         if (b_start <= (Addr )a2) {
6178           tmp___4 = 1;   6194           tmp___4 = 1;
6179         } else {   6195         } else {
6180           tmp___4 = 0;   6196           tmp___4 = 0;
6181         }   6197         }
6182       } else {   6198       } else {
6183         tmp___4 = 0;   6199         tmp___4 = 0;
6184       }   6200       }
6185       tmp___5 = __builtin_expect((long )tmp___4, 1L);   6201       tmp___5 = __builtin_expect((long )tmp___4, 1L);
6186       if (tmp___5) {   6202       if (tmp___5) {
6187     6203  
6188       } else {   6204       } else {
6189         vgPlain_assert_fail((Bool )0,   6205         vgPlain_assert_fail((Bool )0,
6190                             (Char const   *)"a1 <= b_start && b_start <= a2",   6206                             (Char const   *)"a1 <= b_start && b_start <= a2",
6191                             (Char const   *)"drd_bitmap.c", 507,   6207                             (Char const   *)"drd_bitmap.c", 507,
6192                             (Char const   *)"vgDrd_bm_has_any_access", "");   6208                             (Char const   *)"vgDrd_bm_has_any_access", "");
6193       }   6209       }
6194       tmp___6 = make_address(bm2->addr + 1UL, (UWord const   )0);   6210       tmp___6 = make_address(bm2->addr + 1UL, (UWord const   )0);
6195       if (tmp___6 < (Addr )a2) {   6211       if (tmp___6 < (Addr )a2) {
6196         b_end = make_address(bm2->addr + 1UL, (UWord const   )0);   6212         b_end = make_address(bm2->addr + 1UL, (UWord const   )0);
6197       } else {   6213       } else {
6198         b_end = (Addr )a2;   6214         b_end = (Addr )a2;
6199       }   6215       }
6200       if (a1 <= (Addr const   )b_end) {   6216       if (a1 <= (Addr const   )b_end) {
6201         if (b_end <= (Addr )a2) {   6217         if (b_end <= (Addr )a2) {
6202           tmp___7 = 1;   6218           tmp___7 = 1;
6203         } else {   6219         } else {
6204           tmp___7 = 0;   6220           tmp___7 = 0;
6205         }   6221         }
6206       } else {   6222       } else {
6207         tmp___7 = 0;   6223         tmp___7 = 0;
6208       }   6224       }
6209       tmp___8 = __builtin_expect((long )tmp___7, 1L);   6225       tmp___8 = __builtin_expect((long )tmp___7, 1L);
6210       if (tmp___8) {   6226       if (tmp___8) {
6211     6227  
6212       } else {   6228       } else {
6213         vgPlain_assert_fail((Bool )0,   6229         vgPlain_assert_fail((Bool )0,
6214                             (Char const   *)"a1 <= b_end && b_end <= a2",   6230                             (Char const   *)"a1 <= b_end && b_end <= a2",
6215                             (Char const   *)"drd_bitmap.c", 513,   6231                             (Char const   *)"drd_bitmap.c", 513,
6216                             (Char const   *)"vgDrd_bm_has_any_access", "");   6232                             (Char const   *)"vgDrd_bm_has_any_access", "");
6217       }   6233       }
6218       tmp___9 = __builtin_expect((long )(! (! (b_start < b_end))), 1L);   6234       tmp___9 = __builtin_expect((long )(! (! (b_start < b_end))), 1L);
6219       if (tmp___9) {   6235       if (tmp___9) {
6220     6236  
6221       } else {   6237       } else {
6222         vgPlain_assert_fail((Bool )0, (Char const   *)"b_start < b_end",   6238         vgPlain_assert_fail((Bool )0, (Char const   *)"b_start < b_end",
6223                             (Char const   *)"drd_bitmap.c", 514,   6239                             (Char const   *)"drd_bitmap.c", 514,
6224                             (Char const   *)"vgDrd_bm_has_any_access", "");   6240                             (Char const   *)"vgDrd_bm_has_any_access", "");
6225       }   6241       }
6226       tmp___10 = address_lsb((Addr const   )b_start);   6242       tmp___10 = address_lsb((Addr const   )b_start);
6227       tmp___11 = address_lsb((Addr const   )(b_end - 1UL));   6243       tmp___11 = address_lsb((Addr const   )(b_end - 1UL));
6228       if (tmp___10 <= tmp___11) {   6244       if (tmp___10 <= tmp___11) {
6229         tmp___12 = 1;   6245         tmp___12 = 1;
6230       } else {   6246       } else {
6231         tmp___12 = 0;   6247         tmp___12 = 0;
6232       }   6248       }
6233       tmp___13 = __builtin_expect((long )tmp___12, 1L);   6249       tmp___13 = __builtin_expect((long )tmp___12, 1L);
6234       if (tmp___13) {   6250       if (tmp___13) {
6235     6251  
6236       } else {   6252       } else {
6237         vgPlain_assert_fail((Bool )0,   6253         vgPlain_assert_fail((Bool )0,
6238                             (Char const   *)"address_lsb(b_start) <= address_lsb(b_end - 1)",   6254                             (Char const   *)"address_lsb(b_start) <= address_lsb(b_end - 1)",
6239                             (Char const   *)"drd_bitmap.c", 515,   6255                             (Char const   *)"drd_bitmap.c", 515,
6240                             (Char const   *)"vgDrd_bm_has_any_access", "");   6256                             (Char const   *)"vgDrd_bm_has_any_access", "");
6241       }   6257       }
6242       b0 = address_lsb((Addr const   )b_start);   6258       b0 = address_lsb((Addr const   )b_start);
6243       while (1) {   6259       while (1) {
6244         tmp___16 = address_lsb((Addr const   )(b_end - 1UL));   6260         tmp___16 = address_lsb((Addr const   )(b_end - 1UL));
6245         if (b0 <= tmp___16) {   6261         if (b0 <= tmp___16) {
6246     6262  
6247         } else {   6263         } else {
6248           break;   6264           break;
6249         }   6265         }
6250         tmp___14 = bm0_is_set((UWord const   *)(p1->bm0_r), (UWord const   )b0);   6266         tmp___14 = bm0_is_set((UWord const   *)(p1->bm0_r), (UWord const   )b0);
6251         tmp___15 = bm0_is_set((UWord const   *)(p1->bm0_w), (UWord const   )b0);   6267         tmp___15 = bm0_is_set((UWord const   *)(p1->bm0_w), (UWord const   )b0);
6252         if (tmp___14 | tmp___15) {   6268         if (tmp___14 | tmp___15) {
6253           return ((Bool )1);   6269           return ((Bool )1);
6254         } else {   6270         } else {
6255     6271  
6256         }   6272         }
6257         b0 ++;   6273         b0 ++;
6258       }   6274       }
6259     } else {   6275     } else {
6260     6276  
6261     }   6277     }
6262     b = b_next;   6278     b = b_next;
6263   }   6279   }
6264   return ((Bool )0);   6280   return ((Bool )0);
6265 }   6281 }
6266 }   6282 }
6267 Bool vgDrd_bm_has_1(struct bitmap * const  bm , Addr const   a ,   6283 Bool vgDrd_bm_has_1(struct bitmap * const  bm , Addr const   a ,
6268                     BmAccessTypeT const   access_type )   6284                     BmAccessTypeT const   access_type )
6269 {   6285 {
6270   struct bitmap2  const  *p2 ;   6286   struct bitmap2  const  *p2 ;
6271   struct bitmap1  const  *p1 ;   6287   struct bitmap1  const  *p1 ;
6272   UWord const   *p0 ;   6288   UWord const   *p0 ;
6273   UWord a0 ;   6289   UWord a0 ;
6274   UWord tmp ;   6290   UWord tmp ;
6275   long tmp___0 ;   6291   long tmp___0 ;
6276   UWord tmp___1 ;   6292   UWord tmp___1 ;
6277   UWord tmp___2 ;   6293   UWord tmp___2 ;
6278   int tmp___3 ;   6294   int tmp___3 ;
6279   UWord tmp___4 ;   6295   UWord tmp___4 ;
6280     6296  
6281   {   6297   {
6282   tmp = address_lsb(a);   6298   tmp = address_lsb(a);
6283   a0 = tmp;   6299   a0 = tmp;
6284   tmp___0 = __builtin_expect((long )(! (! bm)), 1L);   6300   tmp___0 = __builtin_expect((long )(! (! bm)), 1L);
6285   if (tmp___0) {   6301   if (tmp___0) {
6286     6302  
6287   } else {   6303   } else {
6288     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",   6304     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",
6289                         (Char const   *)"drd_bitmap.c", 545,   6305                         (Char const   *)"drd_bitmap.c", 545,
6290                         (Char const   *)"vgDrd_bm_has_1", "");   6306                         (Char const   *)"vgDrd_bm_has_1", "");
6291   }   6307   }
6292   tmp___1 = address_msb(a);   6308   tmp___1 = address_msb(a);
6293   p2 = bm2_lookup(bm, (UWord const   )tmp___1);   6309   p2 = bm2_lookup(bm, (UWord const   )tmp___1);
6294   if (p2) {   6310   if (p2) {
6295     p1 = & p2->bm1;   6311     p1 = & p2->bm1;
6296     if ((unsigned int const   )access_type == 0U) {   6312     if ((unsigned int const   )access_type == 0U) {
6297       p0 = (UWord const   *)(p1->bm0_r);   6313       p0 = (UWord const   *)(p1->bm0_r);
6298     } else {   6314     } else {
6299       p0 = (UWord const   *)(p1->bm0_w);   6315       p0 = (UWord const   *)(p1->bm0_w);
6300     }   6316     }
6301     tmp___4 = bm0_is_set(p0, (UWord const   )a0);   6317     tmp___4 = bm0_is_set(p0, (UWord const   )a0);
6302     if (tmp___4) {   6318     if (tmp___4) {
6303       tmp___3 = (int )((Bool )1);   6319       tmp___3 = (int )((Bool )1);
6304     } else {   6320     } else {
6305       tmp___3 = (int )((Bool )0);   6321       tmp___3 = (int )((Bool )0);
6306     }   6322     }
6307     return ((Bool )tmp___3);   6323     return ((Bool )tmp___3);
6308   } else {   6324   } else {
6309     6325  
6310   }   6326   }
6311   return ((Bool )0);   6327   return ((Bool )0);
6312 }   6328 }
6313 }   6329 }
6314 void vgDrd_bm_clear(struct bitmap * const  bm , Addr const   a1 ,   6330 void vgDrd_bm_clear(struct bitmap * const  bm , Addr const   a1 ,
6315                     Addr const   a2 )   6331                     Addr const   a2 )
6316 {   6332 {
6317   Addr b ;   6333   Addr b ;
6318   Addr b_next ;   6334   Addr b_next ;
6319   long tmp ;   6335   long tmp ;
6320   long tmp___0 ;   6336   long tmp___0 ;
6321   long tmp___1 ;   6337   long tmp___1 ;
6322   Addr tmp___2 ;   6338   Addr tmp___2 ;
6323   int tmp___3 ;   6339   int tmp___3 ;
6324   long tmp___4 ;   6340   long tmp___4 ;
6325   Addr tmp___5 ;   6341   Addr tmp___5 ;
6326   int tmp___6 ;   6342   int tmp___6 ;
6327   long tmp___7 ;   6343   long tmp___7 ;
6328   struct bitmap2 *p2 ;   6344   struct bitmap2 *p2 ;
6329   Addr c ;   6345   Addr c ;
6330   UWord tmp___8 ;   6346   UWord tmp___8 ;
6331   Addr c_next ;   6347   Addr c_next ;
6332   Addr tmp___9 ;   6348   Addr tmp___9 ;
6333   UWord tmp___10 ;   6349   UWord tmp___10 ;
6334   UWord tmp___11 ;   6350   UWord tmp___11 ;
6335   UWord tmp___12 ;   6351   UWord tmp___12 ;
6336   UWord tmp___13 ;   6352   UWord tmp___13 ;
6337   Addr c_next___0 ;   6353   Addr c_next___0 ;
6338   Addr tmp___14 ;   6354   Addr tmp___14 ;
6339   UWord idx ;   6355   UWord idx ;
6340   UWord tmp___15 ;   6356   UWord tmp___15 ;
6341   UWord tmp___16 ;   6357   UWord tmp___16 ;
6342   UWord tmp___17 ;   6358   UWord tmp___17 ;
6343   UWord tmp___18 ;   6359   UWord tmp___18 ;
6344   UWord tmp___19 ;   6360   UWord tmp___19 ;
6345   UWord tmp___20 ;   6361   UWord tmp___20 ;
6346     6362  
6347   {   6363   {
6348   tmp = __builtin_expect((long )(! (! bm)), 1L);   6364   tmp = __builtin_expect((long )(! (! bm)), 1L);
6349   if (tmp) {   6365   if (tmp) {
6350     6366  
6351   } else {   6367   } else {
6352     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",   6368     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",
6353                         (Char const   *)"drd_bitmap.c", 561,   6369                         (Char const   *)"drd_bitmap.c", 561,
6354                         (Char const   *)"vgDrd_bm_clear", "");   6370                         (Char const   *)"vgDrd_bm_clear", "");
6355   }   6371   }
6356   tmp___0 = __builtin_expect((long )(! (! a1)), 1L);   6372   tmp___0 = __builtin_expect((long )(! (! a1)), 1L);
6357   if (tmp___0) {   6373   if (tmp___0) {
6358     6374  
6359   } else {   6375   } else {
6360     vgPlain_assert_fail((Bool )0, (Char const   *)"a1",   6376     vgPlain_assert_fail((Bool )0, (Char const   *)"a1",
6361                         (Char const   *)"drd_bitmap.c", 562,   6377                         (Char const   *)"drd_bitmap.c", 562,
6362                         (Char const   *)"vgDrd_bm_clear", "");   6378                         (Char const   *)"vgDrd_bm_clear", "");
6363   }   6379   }
6364   tmp___1 = __builtin_expect((long )(! (! (a1 <= a2))), 1L);   6380   tmp___1 = __builtin_expect((long )(! (! (a1 <= a2))), 1L);
6365   if (tmp___1) {   6381   if (tmp___1) {
6366     6382  
6367   } else {   6383   } else {
6368     vgPlain_assert_fail((Bool )0, (Char const   *)"a1 <= a2",   6384     vgPlain_assert_fail((Bool )0, (Char const   *)"a1 <= a2",
6369                         (Char const   *)"drd_bitmap.c", 563,   6385                         (Char const   *)"drd_bitmap.c", 563,
6370                         (Char const   *)"vgDrd_bm_clear", "");   6386                         (Char const   *)"vgDrd_bm_clear", "");
6371   }   6387   }
6372   tmp___2 = first_address_with_same_lsb(a1);   6388   tmp___2 = first_address_with_same_lsb(a1);
6373   if (a1 == (Addr const   )tmp___2) {   6389   if (a1 == (Addr const   )tmp___2) {
6374     tmp___3 = 1;   6390     tmp___3 = 1;
6375   } else {   6391   } else {
6376     tmp___3 = 0;   6392     tmp___3 = 0;
6377   }   6393   }
6378   tmp___4 = __builtin_expect((long )tmp___3, 1L);   6394   tmp___4 = __builtin_expect((long )tmp___3, 1L);
6379   if (tmp___4) {   6395   if (tmp___4) {
6380     6396  
6381   } else {   6397   } else {
6382     vgPlain_assert_fail((Bool )0,   6398     vgPlain_assert_fail((Bool )0,
6383                         (Char const   *)"a1 == first_address_with_same_lsb(a1)",   6399                         (Char const   *)"a1 == first_address_with_same_lsb(a1)",
6384                         (Char const   *)"drd_bitmap.c", 564,   6400                         (Char const   *)"drd_bitmap.c", 564,
6385                         (Char const   *)"vgDrd_bm_clear", "");   6401                         (Char const   *)"vgDrd_bm_clear", "");
6386   }   6402   }
6387   tmp___5 = first_address_with_same_lsb(a2);   6403   tmp___5 = first_address_with_same_lsb(a2);
6388   if (a2 == (Addr const   )tmp___5) {   6404   if (a2 == (Addr const   )tmp___5) {
6389     tmp___6 = 1;   6405     tmp___6 = 1;
6390   } else {   6406   } else {
6391     tmp___6 = 0;   6407     tmp___6 = 0;
6392   }   6408   }
6393   tmp___7 = __builtin_expect((long )tmp___6, 1L);   6409   tmp___7 = __builtin_expect((long )tmp___6, 1L);
6394   if (tmp___7) {   6410   if (tmp___7) {
6395     6411  
6396   } else {   6412   } else {
6397     vgPlain_assert_fail((Bool )0,   6413     vgPlain_assert_fail((Bool )0,
6398                         (Char const   *)"a2 == first_address_with_same_lsb(a2)",   6414                         (Char const   *)"a2 == first_address_with_same_lsb(a2)",
6399                         (Char const   *)"drd_bitmap.c", 565,   6415                         (Char const   *)"drd_bitmap.c", 565,
6400                         (Char const   *)"vgDrd_bm_clear", "");   6416                         (Char const   *)"vgDrd_bm_clear", "");
6401   }   6417   }
6402   b = (Addr )a1;   6418   b = (Addr )a1;
6403   while (b < (Addr )a2) {   6419   while (b < (Addr )a2) {
6404     tmp___8 = address_msb((Addr const   )b);   6420     tmp___8 = address_msb((Addr const   )b);
6405     p2 = bm2_lookup_exclusive(bm, (UWord const   )tmp___8);   6421     p2 = bm2_lookup_exclusive(bm, (UWord const   )tmp___8);
6406     b_next = first_address_with_higher_msb((Addr const   )b);   6422     b_next = first_address_with_higher_msb((Addr const   )b);
6407     if (b_next > (Addr )a2) {   6423     if (b_next > (Addr )a2) {
6408       b_next = (Addr )a2;   6424       b_next = (Addr )a2;
6409     } else {   6425     } else {
6410     6426  
6411     }   6427     }
6412     if ((unsigned int )p2 == (unsigned int )((struct bitmap2 *)0)) {   6428     if ((unsigned int )p2 == (unsigned int )((struct bitmap2 *)0)) {
6413       goto __Cont;   6429       goto __Cont;
6414     } else {   6430     } else {
6415     6431  
6416     }   6432     }
6417     c = b;   6433     c = b;
6418     tmp___12 = address_lsb((Addr const   )c);   6434     tmp___12 = address_lsb((Addr const   )c);
6419     tmp___13 = uword_lsb((UWord const   )tmp___12);   6435     tmp___13 = uword_lsb((UWord const   )tmp___12);
6420     if (tmp___13) {   6436     if (tmp___13) {
6421       tmp___9 = first_address_with_higher_uword_msb((Addr const   )c);   6437       tmp___9 = first_address_with_higher_uword_msb((Addr const   )c);
6422       c_next = tmp___9;   6438       c_next = tmp___9;
6423       if (c_next > b_next) {   6439       if (c_next > b_next) {
6424         c_next = b_next;   6440         c_next = b_next;
6425       } else {   6441       } else {
6426     6442  
6427       }   6443       }
6428       tmp___10 = address_lsb((Addr const   )c);   6444       tmp___10 = address_lsb((Addr const   )c);
    -+ 6445       {
      6446       if (c_next - c < 2) {
      6447         return;
      6448       }
6429       bm0_clear_range(p2->bm1.bm0_r, (UWord const   )tmp___10, = 6449       bm0_clear_range(p2->bm1.bm0_r, (UWord const   )tmp___10,
6430                       (SizeT const   )(((c_next - c) - 1UL) + 1UL));   6450                       (SizeT const   )(((c_next - c) - 1UL) + 1UL));
    -+ 6451       }
6431       tmp___11 = address_lsb((Addr const   )c); = 6452       tmp___11 = address_lsb((Addr const   )c);
    -+ 6453       {
      6454       if (c_next - c < 2) {
      6455         return;
      6456       }
6432       bm0_clear_range(p2->bm1.bm0_w, (UWord const   )tmp___11, = 6457       bm0_clear_range(p2->bm1.bm0_w, (UWord const   )tmp___11,
6433                       (SizeT const   )(((c_next - c) - 1UL) + 1UL));   6458                       (SizeT const   )(((c_next - c) - 1UL) + 1UL));
    -+ 6459       }
6434       c = c_next; = 6460       c = c_next;
6435     } else {   6461     } else {
6436     6462  
6437     }   6463     }
6438     tmp___17 = address_lsb((Addr const   )c);   6464     tmp___17 = address_lsb((Addr const   )c);
6439     tmp___18 = uword_lsb((UWord const   )tmp___17);   6465     tmp___18 = uword_lsb((UWord const   )tmp___17);
6440     if (tmp___18 == 0UL) {   6466     if (tmp___18 == 0UL) {
6441       tmp___14 = first_address_with_same_uword_lsb((Addr const   )b_next);   6467       tmp___14 = first_address_with_same_uword_lsb((Addr const   )b_next);
6442       c_next___0 = tmp___14;   6468       c_next___0 = tmp___14;
6443       if (c_next___0 > c) {   6469       if (c_next___0 > c) {
6444         tmp___15 = address_lsb((Addr const   )c);   6470         tmp___15 = address_lsb((Addr const   )c);
6445         tmp___16 = uword_msb((UWord const   )tmp___15);   6471         tmp___16 = uword_msb((UWord const   )tmp___15);
6446         idx = tmp___16;   6472         idx = tmp___16;
    -+ 6473         {
      6474         if ((c_next___0 - c) / 8UL < 2) {
      6475           return;
      6476         }
6447         vgPlain_memset((void *)(& p2->bm1.bm0_r[idx]), 0, = 6477         vgPlain_memset((void *)(& p2->bm1.bm0_r[idx]), 0,
6448                        ((c_next___0 - c) / 8UL - 1UL) + 1UL);   6478                        ((c_next___0 - c) / 8UL - 1UL) + 1UL);
    -+ 6479         }
      6480         {
      6481         if ((c_next___0 - c) / 8UL < 2) {
      6482           return;
      6483         }
6449         vgPlain_memset((void *)(& p2->bm1.bm0_w[idx]), 0, = 6484         vgPlain_memset((void *)(& p2->bm1.bm0_w[idx]), 0,
6450                        ((c_next___0 - c) / 8UL - 1UL) + 1UL);   6485                        ((c_next___0 - c) / 8UL - 1UL) + 1UL);
    -+ 6486         }
6451         c = c_next___0; = 6487         c = c_next___0;
6452       } else {   6488       } else {
6453     6489  
6454       }   6490       }
6455     } else {   6491     } else {
6456     6492  
6457     }   6493     }
6458     tmp___19 = address_lsb((Addr const   )c);   6494     tmp___19 = address_lsb((Addr const   )c);
    -+ 6495     {
      6496     if (b_next - c < 2) {
      6497       return;
      6498     }
6459     bm0_clear_range(p2->bm1.bm0_r, (UWord const   )tmp___19, = 6499     bm0_clear_range(p2->bm1.bm0_r, (UWord const   )tmp___19,
6460                     (SizeT const   )(((b_next - c) - 1UL) + 1UL));   6500                     (SizeT const   )(((b_next - c) - 1UL) + 1UL));
    -+ 6501     }
6461     tmp___20 = address_lsb((Addr const   )c); = 6502     tmp___20 = address_lsb((Addr const   )c);
    -+ 6503     {
      6504     if (b_next - c < 2) {
      6505       return;
      6506     }
6462     bm0_clear_range(p2->bm1.bm0_w, (UWord const   )tmp___20, = 6507     bm0_clear_range(p2->bm1.bm0_w, (UWord const   )tmp___20,
6463                     (SizeT const   )(((b_next - c) - 1UL) + 1UL));   6508                     (SizeT const   )(((b_next - c) - 1UL) + 1UL));
    -+ 6509     }
6464     __Cont: /* CIL Label */ = 6510     __Cont: /* CIL Label */
6465     b = b_next;   6511     b = b_next;
6466   }   6512   }
6467   return;   6513   return;
6468 }   6514 }
6469 }   6515 }
6470 void vgDrd_bm_clear_load(struct bitmap * const  bm , Addr const   a1 ,   6516 void vgDrd_bm_clear_load(struct bitmap * const  bm , Addr const   a1 ,
6471                          Addr const   a2 )   6517                          Addr const   a2 )
6472 {   6518 {
6473   Addr b ;   6519   Addr b ;
6474   Addr b_next ;   6520   Addr b_next ;
6475   long tmp ;   6521   long tmp ;
6476   long tmp___0 ;   6522   long tmp___0 ;
6477   long tmp___1 ;   6523   long tmp___1 ;
6478   Addr tmp___2 ;   6524   Addr tmp___2 ;
6479   int tmp___3 ;   6525   int tmp___3 ;
6480   long tmp___4 ;   6526   long tmp___4 ;
6481   Addr tmp___5 ;   6527   Addr tmp___5 ;
6482   int tmp___6 ;   6528   int tmp___6 ;
6483   long tmp___7 ;   6529   long tmp___7 ;
6484   struct bitmap2 *p2 ;   6530   struct bitmap2 *p2 ;
6485   Addr c ;   6531   Addr c ;
6486   UWord tmp___8 ;   6532   UWord tmp___8 ;
6487   Addr c_next ;   6533   Addr c_next ;
6488   Addr tmp___9 ;   6534   Addr tmp___9 ;
6489   UWord tmp___10 ;   6535   UWord tmp___10 ;
6490   UWord tmp___11 ;   6536   UWord tmp___11 ;
6491   UWord tmp___12 ;   6537   UWord tmp___12 ;
6492   Addr c_next___0 ;   6538   Addr c_next___0 ;
6493   Addr tmp___13 ;   6539   Addr tmp___13 ;
6494   UWord idx ;   6540   UWord idx ;
6495   UWord tmp___14 ;   6541   UWord tmp___14 ;
6496   UWord tmp___15 ;   6542   UWord tmp___15 ;
6497   UWord tmp___16 ;   6543   UWord tmp___16 ;
6498   UWord tmp___17 ;   6544   UWord tmp___17 ;
6499   UWord tmp___18 ;   6545   UWord tmp___18 ;
6500     6546  
6501   {   6547   {
6502   tmp = __builtin_expect((long )(! (! bm)), 1L);   6548   tmp = __builtin_expect((long )(! (! bm)), 1L);
6503   if (tmp) {   6549   if (tmp) {
6504     6550  
6505   } else {   6551   } else {
6506     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",   6552     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",
6507                         (Char const   *)"drd_bitmap.c", 638,   6553                         (Char const   *)"drd_bitmap.c", 638,
6508                         (Char const   *)"vgDrd_bm_clear_load", "");   6554                         (Char const   *)"vgDrd_bm_clear_load", "");
6509   }   6555   }
6510   tmp___0 = __builtin_expect((long )(! (! a1)), 1L);   6556   tmp___0 = __builtin_expect((long )(! (! a1)), 1L);
6511   if (tmp___0) {   6557   if (tmp___0) {
6512     6558  
6513   } else {   6559   } else {
6514     vgPlain_assert_fail((Bool )0, (Char const   *)"a1",   6560     vgPlain_assert_fail((Bool )0, (Char const   *)"a1",
6515                         (Char const   *)"drd_bitmap.c", 639,   6561                         (Char const   *)"drd_bitmap.c", 639,
6516                         (Char const   *)"vgDrd_bm_clear_load", "");   6562                         (Char const   *)"vgDrd_bm_clear_load", "");
6517   }   6563   }
6518   tmp___1 = __builtin_expect((long )(! (! (a1 <= a2))), 1L);   6564   tmp___1 = __builtin_expect((long )(! (! (a1 <= a2))), 1L);
6519   if (tmp___1) {   6565   if (tmp___1) {
6520     6566  
6521   } else {   6567   } else {
6522     vgPlain_assert_fail((Bool )0, (Char const   *)"a1 <= a2",   6568     vgPlain_assert_fail((Bool )0, (Char const   *)"a1 <= a2",
6523                         (Char const   *)"drd_bitmap.c", 640,   6569                         (Char const   *)"drd_bitmap.c", 640,
6524                         (Char const   *)"vgDrd_bm_clear_load", "");   6570                         (Char const   *)"vgDrd_bm_clear_load", "");
6525   }   6571   }
6526   tmp___2 = first_address_with_same_lsb(a1);   6572   tmp___2 = first_address_with_same_lsb(a1);
6527   if (a1 == (Addr const   )tmp___2) {   6573   if (a1 == (Addr const   )tmp___2) {
6528     tmp___3 = 1;   6574     tmp___3 = 1;
6529   } else {   6575   } else {
6530     tmp___3 = 0;   6576     tmp___3 = 0;
6531   }   6577   }
6532   tmp___4 = __builtin_expect((long )tmp___3, 1L);   6578   tmp___4 = __builtin_expect((long )tmp___3, 1L);
6533   if (tmp___4) {   6579   if (tmp___4) {
6534     6580  
6535   } else {   6581   } else {
6536     vgPlain_assert_fail((Bool )0,   6582     vgPlain_assert_fail((Bool )0,
6537                         (Char const   *)"a1 == first_address_with_same_lsb(a1)",   6583                         (Char const   *)"a1 == first_address_with_same_lsb(a1)",
6538                         (Char const   *)"drd_bitmap.c", 641,   6584                         (Char const   *)"drd_bitmap.c", 641,
6539                         (Char const   *)"vgDrd_bm_clear_load", "");   6585                         (Char const   *)"vgDrd_bm_clear_load", "");
6540   }   6586   }
6541   tmp___5 = first_address_with_same_lsb(a2);   6587   tmp___5 = first_address_with_same_lsb(a2);
6542   if (a2 == (Addr const   )tmp___5) {   6588   if (a2 == (Addr const   )tmp___5) {
6543     tmp___6 = 1;   6589     tmp___6 = 1;
6544   } else {   6590   } else {
6545     tmp___6 = 0;   6591     tmp___6 = 0;
6546   }   6592   }
6547   tmp___7 = __builtin_expect((long )tmp___6, 1L);   6593   tmp___7 = __builtin_expect((long )tmp___6, 1L);
6548   if (tmp___7) {   6594   if (tmp___7) {
6549     6595  
6550   } else {   6596   } else {
6551     vgPlain_assert_fail((Bool )0,   6597     vgPlain_assert_fail((Bool )0,
6552                         (Char const   *)"a2 == first_address_with_same_lsb(a2)",   6598                         (Char const   *)"a2 == first_address_with_same_lsb(a2)",
6553                         (Char const   *)"drd_bitmap.c", 642,   6599                         (Char const   *)"drd_bitmap.c", 642,
6554                         (Char const   *)"vgDrd_bm_clear_load", "");   6600                         (Char const   *)"vgDrd_bm_clear_load", "");
6555   }   6601   }
6556   b = (Addr )a1;   6602   b = (Addr )a1;
6557   while (b < (Addr )a2) {   6603   while (b < (Addr )a2) {
6558     tmp___8 = address_msb((Addr const   )b);   6604     tmp___8 = address_msb((Addr const   )b);
6559     p2 = bm2_lookup_exclusive(bm, (UWord const   )tmp___8);   6605     p2 = bm2_lookup_exclusive(bm, (UWord const   )tmp___8);
6560     b_next = first_address_with_higher_msb((Addr const   )b);   6606     b_next = first_address_with_higher_msb((Addr const   )b);
6561     if (b_next > (Addr )a2) {   6607     if (b_next > (Addr )a2) {
6562       b_next = (Addr )a2;   6608       b_next = (Addr )a2;
6563     } else {   6609     } else {
6564     6610  
6565     }   6611     }
6566     if ((unsigned int )p2 == (unsigned int )((struct bitmap2 *)0)) {   6612     if ((unsigned int )p2 == (unsigned int )((struct bitmap2 *)0)) {
6567       goto __Cont;   6613       goto __Cont;
6568     } else {   6614     } else {
6569     6615  
6570     }   6616     }
6571     c = b;   6617     c = b;
6572     tmp___11 = address_lsb((Addr const   )c);   6618     tmp___11 = address_lsb((Addr const   )c);
6573     tmp___12 = uword_lsb((UWord const   )tmp___11);   6619     tmp___12 = uword_lsb((UWord const   )tmp___11);
6574     if (tmp___12) {   6620     if (tmp___12) {
6575       tmp___9 = first_address_with_higher_uword_msb((Addr const   )c);   6621       tmp___9 = first_address_with_higher_uword_msb((Addr const   )c);
6576       c_next = tmp___9;   6622       c_next = tmp___9;
6577       if (c_next > b_next) {   6623       if (c_next > b_next) {
6578         c_next = b_next;   6624         c_next = b_next;
6579       } else {   6625       } else {
6580     6626  
6581       }   6627       }
6582       tmp___10 = address_lsb((Addr const   )c);   6628       tmp___10 = address_lsb((Addr const   )c);
    -+ 6629       {
      6630       if (c_next - c < 2) {
      6631         return;
      6632       }
6583       bm0_clear_range(p2->bm1.bm0_r, (UWord const   )tmp___10, = 6633       bm0_clear_range(p2->bm1.bm0_r, (UWord const   )tmp___10,
6584                       (SizeT const   )(((c_next - c) - 1UL) + 1UL));   6634                       (SizeT const   )(((c_next - c) - 1UL) + 1UL));
    -+ 6635       }
6585       c = c_next; = 6636       c = c_next;
6586     } else {   6637     } else {
6587     6638  
6588     }   6639     }
6589     tmp___16 = address_lsb((Addr const   )c);   6640     tmp___16 = address_lsb((Addr const   )c);
6590     tmp___17 = uword_lsb((UWord const   )tmp___16);   6641     tmp___17 = uword_lsb((UWord const   )tmp___16);
6591     if (tmp___17 == 0UL) {   6642     if (tmp___17 == 0UL) {
6592       tmp___13 = first_address_with_same_uword_lsb((Addr const   )b_next);   6643       tmp___13 = first_address_with_same_uword_lsb((Addr const   )b_next);
6593       c_next___0 = tmp___13;   6644       c_next___0 = tmp___13;
6594       if (c_next___0 > c) {   6645       if (c_next___0 > c) {
6595         tmp___14 = address_lsb((Addr const   )c);   6646         tmp___14 = address_lsb((Addr const   )c);
6596         tmp___15 = uword_msb((UWord const   )tmp___14);   6647         tmp___15 = uword_msb((UWord const   )tmp___14);
6597         idx = tmp___15;   6648         idx = tmp___15;
    -+ 6649         {
      6650         if ((c_next___0 - c) / 8UL < 2) {
      6651           return;
      6652         }
6598         vgPlain_memset((void *)(& p2->bm1.bm0_r[idx]), 0, = 6653         vgPlain_memset((void *)(& p2->bm1.bm0_r[idx]), 0,
6599                        ((c_next___0 - c) / 8UL - 1UL) + 1UL);   6654                        ((c_next___0 - c) / 8UL - 1UL) + 1UL);
    -+ 6655         }
6600         c = c_next___0; = 6656         c = c_next___0;
6601       } else {   6657       } else {
6602     6658  
6603       }   6659       }
6604     } else {   6660     } else {
6605     6661  
6606     }   6662     }
6607     tmp___18 = address_lsb((Addr const   )c);   6663     tmp___18 = address_lsb((Addr const   )c);
    -+ 6664     {
      6665     if (b_next - c < 2) {
      6666       return;
      6667     }
6608     bm0_clear_range(p2->bm1.bm0_r, (UWord const   )tmp___18, = 6668     bm0_clear_range(p2->bm1.bm0_r, (UWord const   )tmp___18,
6609                     (SizeT const   )(((b_next - c) - 1UL) + 1UL));   6669                     (SizeT const   )(((b_next - c) - 1UL) + 1UL));
    -+ 6670     }
6610     __Cont: /* CIL Label */ = 6671     __Cont: /* CIL Label */
6611     b = b_next;   6672     b = b_next;
6612   }   6673   }
6613   return;   6674   return;
6614 }   6675 }
6615 }   6676 }
6616 void vgDrd_bm_clear_store(struct bitmap * const  bm , Addr const   a1 ,   6677 void vgDrd_bm_clear_store(struct bitmap * const  bm , Addr const   a1 ,
6617                           Addr const   a2 )   6678                           Addr const   a2 )
6618 {   6679 {
6619   Addr b ;   6680   Addr b ;
6620   Addr b_next ;   6681   Addr b_next ;
6621   long tmp ;   6682   long tmp ;
6622   long tmp___0 ;   6683   long tmp___0 ;
6623   long tmp___1 ;   6684   long tmp___1 ;
6624   Addr tmp___2 ;   6685   Addr tmp___2 ;
6625   int tmp___3 ;   6686   int tmp___3 ;
6626   long tmp___4 ;   6687   long tmp___4 ;
6627   Addr tmp___5 ;   6688   Addr tmp___5 ;
6628   int tmp___6 ;   6689   int tmp___6 ;
6629   long tmp___7 ;   6690   long tmp___7 ;
6630   struct bitmap2 *p2 ;   6691   struct bitmap2 *p2 ;
6631   Addr c ;   6692   Addr c ;
6632   UWord tmp___8 ;   6693   UWord tmp___8 ;
6633   Addr c_next ;   6694   Addr c_next ;
6634   Addr tmp___9 ;   6695   Addr tmp___9 ;
6635   UWord tmp___10 ;   6696   UWord tmp___10 ;
6636   UWord tmp___11 ;   6697   UWord tmp___11 ;
6637   UWord tmp___12 ;   6698   UWord tmp___12 ;
6638   Addr c_next___0 ;   6699   Addr c_next___0 ;
6639   Addr tmp___13 ;   6700   Addr tmp___13 ;
6640   UWord idx ;   6701   UWord idx ;
6641   UWord tmp___14 ;   6702   UWord tmp___14 ;
6642   UWord tmp___15 ;   6703   UWord tmp___15 ;
6643   UWord tmp___16 ;   6704   UWord tmp___16 ;
6644   UWord tmp___17 ;   6705   UWord tmp___17 ;
6645   UWord tmp___18 ;   6706   UWord tmp___18 ;
6646     6707  
6647   {   6708   {
6648   tmp = __builtin_expect((long )(! (! bm)), 1L);   6709   tmp = __builtin_expect((long )(! (! bm)), 1L);
6649   if (tmp) {   6710   if (tmp) {
6650     6711  
6651   } else {   6712   } else {
6652     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",   6713     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",
6653                         (Char const   *)"drd_bitmap.c", 720,   6714                         (Char const   *)"drd_bitmap.c", 720,
6654                         (Char const   *)"vgDrd_bm_clear_store", "");   6715                         (Char const   *)"vgDrd_bm_clear_store", "");
6655   }   6716   }
6656   tmp___0 = __builtin_expect((long )(! (! a1)), 1L);   6717   tmp___0 = __builtin_expect((long )(! (! a1)), 1L);
6657   if (tmp___0) {   6718   if (tmp___0) {
6658     6719  
6659   } else {   6720   } else {
6660     vgPlain_assert_fail((Bool )0, (Char const   *)"a1",   6721     vgPlain_assert_fail((Bool )0, (Char const   *)"a1",
6661                         (Char const   *)"drd_bitmap.c", 721,   6722                         (Char const   *)"drd_bitmap.c", 721,
6662                         (Char const   *)"vgDrd_bm_clear_store", "");   6723                         (Char const   *)"vgDrd_bm_clear_store", "");
6663   }   6724   }
6664   tmp___1 = __builtin_expect((long )(! (! (a1 <= a2))), 1L);   6725   tmp___1 = __builtin_expect((long )(! (! (a1 <= a2))), 1L);
6665   if (tmp___1) {   6726   if (tmp___1) {
6666     6727  
6667   } else {   6728   } else {
6668     vgPlain_assert_fail((Bool )0, (Char const   *)"a1 <= a2",   6729     vgPlain_assert_fail((Bool )0, (Char const   *)"a1 <= a2",
6669                         (Char const   *)"drd_bitmap.c", 722,   6730                         (Char const   *)"drd_bitmap.c", 722,
6670                         (Char const   *)"vgDrd_bm_clear_store", "");   6731                         (Char const   *)"vgDrd_bm_clear_store", "");
6671   }   6732   }
6672   tmp___2 = first_address_with_same_lsb(a1);   6733   tmp___2 = first_address_with_same_lsb(a1);
6673   if (a1 == (Addr const   )tmp___2) {   6734   if (a1 == (Addr const   )tmp___2) {
6674     tmp___3 = 1;   6735     tmp___3 = 1;
6675   } else {   6736   } else {
6676     tmp___3 = 0;   6737     tmp___3 = 0;
6677   }   6738   }
6678   tmp___4 = __builtin_expect((long )tmp___3, 1L);   6739   tmp___4 = __builtin_expect((long )tmp___3, 1L);
6679   if (tmp___4) {   6740   if (tmp___4) {
6680     6741  
6681   } else {   6742   } else {
6682     vgPlain_assert_fail((Bool )0,   6743     vgPlain_assert_fail((Bool )0,
6683                         (Char const   *)"a1 == first_address_with_same_lsb(a1)",   6744                         (Char const   *)"a1 == first_address_with_same_lsb(a1)",
6684                         (Char const   *)"drd_bitmap.c", 723,   6745                         (Char const   *)"drd_bitmap.c", 723,
6685                         (Char const   *)"vgDrd_bm_clear_store", "");   6746                         (Char const   *)"vgDrd_bm_clear_store", "");
6686   }   6747   }
6687   tmp___5 = first_address_with_same_lsb(a2);   6748   tmp___5 = first_address_with_same_lsb(a2);
6688   if (a2 == (Addr const   )tmp___5) {   6749   if (a2 == (Addr const   )tmp___5) {
6689     tmp___6 = 1;   6750     tmp___6 = 1;
6690   } else {   6751   } else {
6691     tmp___6 = 0;   6752     tmp___6 = 0;
6692   }   6753   }
6693   tmp___7 = __builtin_expect((long )tmp___6, 1L);   6754   tmp___7 = __builtin_expect((long )tmp___6, 1L);
6694   if (tmp___7) {   6755   if (tmp___7) {
6695     6756  
6696   } else {   6757   } else {
6697     vgPlain_assert_fail((Bool )0,   6758     vgPlain_assert_fail((Bool )0,
6698                         (Char const   *)"a2 == first_address_with_same_lsb(a2)",   6759                         (Char const   *)"a2 == first_address_with_same_lsb(a2)",
6699                         (Char const   *)"drd_bitmap.c", 724,   6760                         (Char const   *)"drd_bitmap.c", 724,
6700                         (Char const   *)"vgDrd_bm_clear_store", "");   6761                         (Char const   *)"vgDrd_bm_clear_store", "");
6701   }   6762   }
6702   b = (Addr )a1;   6763   b = (Addr )a1;
6703   while (b < (Addr )a2) {   6764   while (b < (Addr )a2) {
6704     tmp___8 = address_msb((Addr const   )b);   6765     tmp___8 = address_msb((Addr const   )b);
6705     p2 = bm2_lookup_exclusive(bm, (UWord const   )tmp___8);   6766     p2 = bm2_lookup_exclusive(bm, (UWord const   )tmp___8);
6706     b_next = first_address_with_higher_msb((Addr const   )b);   6767     b_next = first_address_with_higher_msb((Addr const   )b);
6707     if (b_next > (Addr )a2) {   6768     if (b_next > (Addr )a2) {
6708       b_next = (Addr )a2;   6769       b_next = (Addr )a2;
6709     } else {   6770     } else {
6710     6771  
6711     }   6772     }
6712     if ((unsigned int )p2 == (unsigned int )((struct bitmap2 *)0)) {   6773     if ((unsigned int )p2 == (unsigned int )((struct bitmap2 *)0)) {
6713       goto __Cont;   6774       goto __Cont;
6714     } else {   6775     } else {
6715     6776  
6716     }   6777     }
6717     c = b;   6778     c = b;
6718     tmp___11 = address_lsb((Addr const   )c);   6779     tmp___11 = address_lsb((Addr const   )c);
6719     tmp___12 = uword_lsb((UWord const   )tmp___11);   6780     tmp___12 = uword_lsb((UWord const   )tmp___11);
6720     if (tmp___12) {   6781     if (tmp___12) {
6721       tmp___9 = first_address_with_higher_uword_msb((Addr const   )c);   6782       tmp___9 = first_address_with_higher_uword_msb((Addr const   )c);
6722       c_next = tmp___9;   6783       c_next = tmp___9;
6723       if (c_next > b_next) {   6784       if (c_next > b_next) {
6724         c_next = b_next;   6785         c_next = b_next;
6725       } else {   6786       } else {
6726     6787  
6727       }   6788       }
6728       tmp___10 = address_lsb((Addr const   )c);   6789       tmp___10 = address_lsb((Addr const   )c);
    -+ 6790       {
      6791       if (c_next - c < 2) {
      6792         return;
      6793       }
6729       bm0_clear_range(p2->bm1.bm0_w, (UWord const   )tmp___10, = 6794       bm0_clear_range(p2->bm1.bm0_w, (UWord const   )tmp___10,
6730                       (SizeT const   )(((c_next - c) - 1UL) + 1UL));   6795                       (SizeT const   )(((c_next - c) - 1UL) + 1UL));
    -+ 6796       }
6731       c = c_next; = 6797       c = c_next;
6732     } else {   6798     } else {
6733     6799  
6734     }   6800     }
6735     tmp___16 = address_lsb((Addr const   )c);   6801     tmp___16 = address_lsb((Addr const   )c);
6736     tmp___17 = uword_lsb((UWord const   )tmp___16);   6802     tmp___17 = uword_lsb((UWord const   )tmp___16);
6737     if (tmp___17 == 0UL) {   6803     if (tmp___17 == 0UL) {
6738       tmp___13 = first_address_with_same_uword_lsb((Addr const   )b_next);   6804       tmp___13 = first_address_with_same_uword_lsb((Addr const   )b_next);
6739       c_next___0 = tmp___13;   6805       c_next___0 = tmp___13;
6740       if (c_next___0 > c) {   6806       if (c_next___0 > c) {
6741         tmp___14 = address_lsb((Addr const   )c);   6807         tmp___14 = address_lsb((Addr const   )c);
6742         tmp___15 = uword_msb((UWord const   )tmp___14);   6808         tmp___15 = uword_msb((UWord const   )tmp___14);
6743         idx = tmp___15;   6809         idx = tmp___15;
    -+ 6810         {
      6811         if ((c_next___0 - c) / 8UL < 2) {
      6812           return;
      6813         }
6744         vgPlain_memset((void *)(& p2->bm1.bm0_w[idx]), 0, = 6814         vgPlain_memset((void *)(& p2->bm1.bm0_w[idx]), 0,
6745                        ((c_next___0 - c) / 8UL - 1UL) + 1UL);   6815                        ((c_next___0 - c) / 8UL - 1UL) + 1UL);
    -+ 6816         }
6746         c = c_next___0; = 6817         c = c_next___0;
6747       } else {   6818       } else {
6748     6819  
6749       }   6820       }
6750     } else {   6821     } else {
6751     6822  
6752     }   6823     }
6753     tmp___18 = address_lsb((Addr const   )c);   6824     tmp___18 = address_lsb((Addr const   )c);
    -+ 6825     {
      6826     if (b_next - c < 2) {
      6827       return;
      6828     }
6754     bm0_clear_range(p2->bm1.bm0_w, (UWord const   )tmp___18, = 6829     bm0_clear_range(p2->bm1.bm0_w, (UWord const   )tmp___18,
6755                     (SizeT const   )(((b_next - c) - 1UL) + 1UL));   6830                     (SizeT const   )(((b_next - c) - 1UL) + 1UL));
    -+ 6831     }
6756     __Cont: /* CIL Label */ = 6832     __Cont: /* CIL Label */
6757     b = b_next;   6833     b = b_next;
6758   }   6834   }
6759   return;   6835   return;
6760 }   6836 }
6761 }   6837 }
6762 Bool vgDrd_bm_test_and_clear(struct bitmap * const  bm , Addr const   a1 ,   6838 Bool vgDrd_bm_test_and_clear(struct bitmap * const  bm , Addr const   a1 ,
6763                              Addr const   a2 )   6839                              Addr const   a2 )
6764 {   6840 {
6765   Bool result ;   6841   Bool result ;
6766   Bool tmp ;   6842   Bool tmp ;
6767     6843  
6768   {   6844   {
6769   tmp = vgDrd_bm_has_any_access(bm, a1, a2);   6845   tmp = vgDrd_bm_has_any_access(bm, a1, a2);
6770   result = (Bool )((int )tmp != 0);   6846   result = (Bool )((int )tmp != 0);
6771   vgDrd_bm_clear(bm, a1, a2);   6847   vgDrd_bm_clear(bm, a1, a2);
6772   return (result);   6848   return (result);
6773 }   6849 }
6774 }   6850 }
6775 Bool vgDrd_bm_has_conflict_with(struct bitmap * const  bm , Addr const   a1 ,   6851 Bool vgDrd_bm_has_conflict_with(struct bitmap * const  bm , Addr const   a1 ,
6776                                 Addr const   a2 ,   6852                                 Addr const   a2 ,
6777                                 BmAccessTypeT const   access_type )   6853                                 BmAccessTypeT const   access_type )
6778 {   6854 {
6779   Addr b ;   6855   Addr b ;
6780   Addr b_next ;   6856   Addr b_next ;
6781   long tmp ;   6857   long tmp ;
6782   struct bitmap2  const  *bm2 ;   6858   struct bitmap2  const  *bm2 ;
6783   UWord tmp___0 ;   6859   UWord tmp___0 ;
6784   struct bitmap2  const  *tmp___1 ;   6860   struct bitmap2  const  *tmp___1 ;
6785   Addr b_start ;   6861   Addr b_start ;
6786   Addr b_end ;   6862   Addr b_end ;
6787   UWord b0 ;   6863   UWord b0 ;
6788   struct bitmap1  const  *p1 ;   6864   struct bitmap1  const  *p1 ;
6789   Addr tmp___2 ;   6865   Addr tmp___2 ;
6790   Addr tmp___3 ;   6866   Addr tmp___3 ;
6791   int tmp___4 ;   6867   int tmp___4 ;
6792   long tmp___5 ;   6868   long tmp___5 ;
6793   Addr tmp___6 ;   6869   Addr tmp___6 ;
6794   int tmp___7 ;   6870   int tmp___7 ;
6795   long tmp___8 ;   6871   long tmp___8 ;
6796   long tmp___9 ;   6872   long tmp___9 ;
6797   UWord tmp___10 ;   6873   UWord tmp___10 ;
6798   UWord tmp___11 ;   6874   UWord tmp___11 ;
6799   int tmp___12 ;   6875   int tmp___12 ;
6800   long tmp___13 ;   6876   long tmp___13 ;
6801   UWord tmp___14 ;   6877   UWord tmp___14 ;
6802   long tmp___15 ;   6878   long tmp___15 ;
6803   UWord tmp___16 ;   6879   UWord tmp___16 ;
6804   UWord tmp___17 ;   6880   UWord tmp___17 ;
6805   UWord tmp___18 ;   6881   UWord tmp___18 ;
6806     6882  
6807   {   6883   {
6808   tmp = __builtin_expect((long )(! (! bm)), 1L);   6884   tmp = __builtin_expect((long )(! (! bm)), 1L);
6809   if (tmp) {   6885   if (tmp) {
6810     6886  
6811   } else {   6887   } else {
6812     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",   6888     vgPlain_assert_fail((Bool )0, (Char const   *)"bm",
6813                         (Char const   *)"drd_bitmap.c", 814,   6889                         (Char const   *)"drd_bitmap.c", 814,
6814                         (Char const   *)"vgDrd_bm_has_conflict_with", "");   6890                         (Char const   *)"vgDrd_bm_has_conflict_with", "");
6815   }   6891   }
6816   b = (Addr )a1;   6892   b = (Addr )a1;
6817   while (b < (Addr )a2) {   6893   while (b < (Addr )a2) {
6818     tmp___0 = address_msb((Addr const   )b);   6894     tmp___0 = address_msb((Addr const   )b);
6819     tmp___1 = bm2_lookup(bm, (UWord const   )tmp___0);   6895     tmp___1 = bm2_lookup(bm, (UWord const   )tmp___0);
6820     bm2 = tmp___1;   6896     bm2 = tmp___1;
6821     b_next = first_address_with_higher_msb((Addr const   )b);   6897     b_next = first_address_with_higher_msb((Addr const   )b);
6822     if (b_next > (Addr )a2) {   6898     if (b_next > (Addr )a2) {
6823       b_next = (Addr )a2;   6899       b_next = (Addr )a2;
6824     } else {   6900     } else {
6825     6901  
6826     }   6902     }
6827     if (bm2) {   6903     if (bm2) {
6828       p1 = & bm2->bm1;   6904       p1 = & bm2->bm1;
6829       tmp___3 = make_address(bm2->addr, (UWord const   )0);   6905       tmp___3 = make_address(bm2->addr, (UWord const   )0);
6830       if (tmp___3 < (Addr )a1) {   6906       if (tmp___3 < (Addr )a1) {
6831         b_start = (Addr )a1;   6907         b_start = (Addr )a1;
6832       } else {   6908       } else {
6833         tmp___2 = make_address(bm2->addr, (UWord const   )0);   6909         tmp___2 = make_address(bm2->addr, (UWord const   )0);
6834         if (tmp___2 < (Addr )a2) {   6910         if (tmp___2 < (Addr )a2) {
6835           b_start = make_address(bm2->addr, (UWord const   )0);   6911           b_start = make_address(bm2->addr, (UWord const   )0);
6836         } else {   6912         } else {
6837           break;   6913           break;
6838         }   6914         }
6839       }   6915       }
6840       if (a1 <= (Addr const   )b_start) {   6916       if (a1 <= (Addr const   )b_start) {
6841         if (b_start <= (Addr )a2) {   6917         if (b_start <= (Addr )a2) {
6842           tmp___4 = 1;   6918           tmp___4 = 1;
6843         } else {   6919         } else {
6844           tmp___4 = 0;   6920           tmp___4 = 0;
6845         }   6921         }
6846       } else {   6922       } else {
6847         tmp___4 = 0;   6923         tmp___4 = 0;
6848       }   6924       }
6849       tmp___5 = __builtin_expect((long )tmp___4, 1L);   6925       tmp___5 = __builtin_expect((long )tmp___4, 1L);
6850       if (tmp___5) {   6926       if (tmp___5) {
6851     6927  
6852       } else {   6928       } else {
6853         vgPlain_assert_fail((Bool )0,   6929         vgPlain_assert_fail((Bool )0,
6854                             (Char const   *)"a1 <= b_start && b_start <= a2",   6930                             (Char const   *)"a1 <= b_start && b_start <= a2",
6855                             (Char const   *)"drd_bitmap.c", 840,   6931                             (Char const   *)"drd_bitmap.c", 840,
6856                             (Char const   *)"vgDrd_bm_has_conflict_with", "");   6932                             (Char const   *)"vgDrd_bm_has_conflict_with", "");
6857       }   6933       }
6858       tmp___6 = make_address(bm2->addr + 1UL, (UWord const   )0);   6934       tmp___6 = make_address(bm2->addr + 1UL, (UWord const   )0);
6859       if (tmp___6 < (Addr )a2) {   6935       if (tmp___6 < (Addr )a2) {
6860         b_end = make_address(bm2->addr + 1UL, (UWord const   )0);   6936         b_end = make_address(bm2->addr + 1UL, (UWord const   )0);
6861       } else {   6937       } else {
6862         b_end = (Addr )a2;   6938         b_end = (Addr )a2;
6863       }   6939       }
6864       if (a1 <= (Addr const   )b_end) {   6940       if (a1 <= (Addr const   )b_end) {
6865         if (b_end <= (Addr )a2) {   6941         if (b_end <= (Addr )a2) {
6866           tmp___7 = 1;   6942           tmp___7 = 1;
6867         } else {   6943         } else {
6868           tmp___7 = 0;   6944           tmp___7 = 0;
6869         }   6945         }
6870       } else {   6946       } else {
6871         tmp___7 = 0;   6947         tmp___7 = 0;
6872       }   6948       }
6873       tmp___8 = __builtin_expect((long )tmp___7, 1L);   6949       tmp___8 = __builtin_expect((long )tmp___7, 1L);
6874       if (tmp___8) {   6950       if (tmp___8) {
6875     6951  
6876       } else {   6952       } else {
6877         vgPlain_assert_fail((Bool )0,   6953         vgPlain_assert_fail((Bool )0,
6878                             (Char const   *)"a1 <= b_end && b_end <= a2",   6954                             (Char const   *)"a1 <= b_end && b_end <= a2",
6879                             (Char const   *)"drd_bitmap.c", 846,   6955                             (Char const   *)"drd_bitmap.c", 846,
6880                             (Char const   *)"vgDrd_bm_has_conflict_with", "");   6956                             (Char const   *)"vgDrd_bm_has_conflict_with", "");
6881       }   6957       }
6882       tmp___9 = __builtin_expect((long )(! (! (b_start < b_end))), 1L);   6958       tmp___9 = __builtin_expect((long )(! (! (b_start < b_end))), 1L);
6883       if (tmp___9) {   6959       if (tmp___9) {
6884     6960  
6885       } else {   6961       } else {
6886         vgPlain_assert_fail((Bool )0, (Char const   *)"b_start < b_end",   6962         vgPlain_assert_fail((Bool )0, (Char const   *)"b_start < b_end",
6887                             (Char const   *)"drd_bitmap.c", 847,   6963                             (Char const   *)"drd_bitmap.c", 847,
6888                             (Char const   *)"vgDrd_bm_has_conflict_with", "");   6964                             (Char const   *)"vgDrd_bm_has_conflict_with", "");
6889       }   6965       }
6890       tmp___10 = address_lsb((Addr const   )b_start);   6966       tmp___10 = address_lsb((Addr const   )b_start);
6891       tmp___11 = address_lsb((Addr const   )(b_end - 1UL));   6967       tmp___11 = address_lsb((Addr const   )(b_end - 1UL));
6892       if (tmp___10 <= tmp___11) {   6968       if (tmp___10 <= tmp___11) {
6893         tmp___12 = 1;   6969         tmp___12 = 1;
6894       } else {   6970       } else {
6895         tmp___12 = 0;   6971         tmp___12 = 0;
6896       }   6972       }
6897       tmp___13 = __builtin_expect((long )tmp___12, 1L);   6973       tmp___13 = __builtin_expect((long )tmp___12, 1L);
6898       if (tmp___13) {   6974       if (tmp___13) {
6899     6975  
6900       } else {   6976       } else {
6901         vgPlain_assert_fail((Bool )0,   6977         vgPlain_assert_fail((Bool )0,
6902                             (Char const   *)"address_lsb(b_start) <= address_lsb(b_end - 1)",   6978                             (Char const   *)"address_lsb(b_start) <= address_lsb(b_end - 1)",
6903                             (Char const   *)"drd_bitmap.c", 848,   6979                             (Char const   *)"drd_bitmap.c", 848,
6904                             (Char const   *)"vgDrd_bm_has_conflict_with", "");   6980                             (Char const   *)"vgDrd_bm_has_conflict_with", "");
6905       }   6981       }
6906       b0 = address_lsb((Addr const   )b_start);   6982       b0 = address_lsb((Addr const   )b_start);
6907       while (1) {   6983       while (1) {
6908         tmp___18 = address_lsb((Addr const   )(b_end - 1UL));   6984         tmp___18 = address_lsb((Addr const   )(b_end - 1UL));
6909         if (b0 <= tmp___18) {   6985         if (b0 <= tmp___18) {
6910     6986  
6911         } else {   6987         } else {
6912           break;   6988           break;
6913         }   6989         }
6914         if ((unsigned int const   )access_type == 0U) {   6990         if ((unsigned int const   )access_type == 0U) {
6915           tmp___14 = bm0_is_set((UWord const   *)(p1->bm0_w), (UWord const   )b0);   6991           tmp___14 = bm0_is_set((UWord const   *)(p1->bm0_w), (UWord const   )b0);
6916           if (tmp___14) {   6992           if (tmp___14) {
6917             return ((Bool )1);   6993             return ((Bool )1);
6918           } else {   6994           } else {
6919     6995  
6920           }   6996           }
6921         } else {   6997         } else {
6922           tmp___15 = __builtin_expect((long )(! (! ((unsigned int const   )access_type == 1U))),   6998           tmp___15 = __builtin_expect((long )(! (! ((unsigned int const   )access_type == 1U))),
6923                                       1L);   6999                                       1L);
6924           if (tmp___15) {   7000           if (tmp___15) {
6925     7001  
6926           } else {   7002           } else {
6927             vgPlain_assert_fail((Bool )0,   7003             vgPlain_assert_fail((Bool )0,
6928                                 (Char const   *)"access_type == eStore",   7004                                 (Char const   *)"access_type == eStore",
6929                                 (Char const   *)"drd_bitmap.c", 861,   7005                                 (Char const   *)"drd_bitmap.c", 861,
6930                                 (Char const   *)"vgDrd_bm_has_conflict_with", "");   7006                                 (Char const   *)"vgDrd_bm_has_conflict_with", "");
6931           }   7007           }
6932           tmp___16 = bm0_is_set((UWord const   *)(p1->bm0_r), (UWord const   )b0);   7008           tmp___16 = bm0_is_set((UWord const   *)(p1->bm0_r), (UWord const   )b0);
6933           tmp___17 = bm0_is_set((UWord const   *)(p1->bm0_w), (UWord const   )b0);   7009           tmp___17 = bm0_is_set((UWord const   *)(p1->bm0_w), (UWord const   )b0);
6934           if (tmp___16 | tmp___17) {   7010           if (tmp___16 | tmp___17) {
6935             return ((Bool )1);   7011             return ((Bool )1);
6936           } else {   7012           } else {
6937     7013  
6938           }   7014           }
6939         }   7015         }
6940         b0 ++;   7016         b0 ++;
6941       }   7017       }
6942     } else {   7018     } else {
6943     7019  
6944     }   7020     }
6945     b = b_next;   7021     b = b_next;
6946   }   7022   }
6947   return ((Bool )0);   7023   return ((Bool )0);
6948 }   7024 }
6949 }   7025 }
6950 Bool vgDrd_bm_load_has_conflict_with(struct bitmap * const  bm ,   7026 Bool vgDrd_bm_load_has_conflict_with(struct bitmap * const  bm ,
6951                                      Addr const   a1 , Addr const   a2 )   7027                                      Addr const   a1 , Addr const   a2 )
6952 {   7028 {
6953   Bool tmp ;   7029   Bool tmp ;
6954     7030  
6955   {   7031   {
6956   tmp = vgDrd_bm_has_conflict_with(bm, a1, a2, (BmAccessTypeT const   )0);   7032   tmp = vgDrd_bm_has_conflict_with(bm, a1, a2, (BmAccessTypeT const   )0);
6957   return (tmp);   7033   return (tmp);
6958 }   7034 }
6959 }   7035 }
6960 Bool vgDrd_bm_load_1_has_conflict_with(struct bitmap * const  bm ,   7036 Bool vgDrd_bm_load_1_has_conflict_with(struct bitmap * const  bm ,
6961                                        Addr const   a1 )   7037                                        Addr const   a1 )
6962 {   7038 {
6963   Bool tmp ;   7039   Bool tmp ;
6964     7040  
6965   {   7041   {
6966   tmp = bm_aligned_load_has_conflict_with(bm, a1, (SizeT const   )1);   7042   tmp = bm_aligned_load_has_conflict_with(bm, a1, (SizeT const   )1);
6967   return (tmp);   7043   return (tmp);
6968 }   7044 }
6969 }   7045 }
6970 Bool vgDrd_bm_load_2_has_conflict_with(struct bitmap * const  bm ,   7046 Bool vgDrd_bm_load_2_has_conflict_with(struct bitmap * const  bm ,
6971                                        Addr const   a1 )   7047                                        Addr const   a1 )
6972 {   7048 {
6973   Bool tmp ;   7049   Bool tmp ;
6974   Bool tmp___0 ;   7050   Bool tmp___0 ;
6975     7051  
6976   {   7052   {
6977   if ((a1 & 1UL) == 0UL) {   7053   if ((a1 & 1UL) == 0UL) {
6978     tmp = bm_aligned_load_has_conflict_with(bm, a1, (SizeT const   )2);   7054     tmp = bm_aligned_load_has_conflict_with(bm, a1, (SizeT const   )2);
6979     return (tmp);   7055     return (tmp);
6980   } else {   7056   } else {
6981     tmp___0 = vgDrd_bm_has_conflict_with(bm, a1, a1 + 2UL,   7057     tmp___0 = vgDrd_bm_has_conflict_with(bm, a1, a1 + 2UL,
6982                                          (BmAccessTypeT const   )0);   7058                                          (BmAccessTypeT const   )0);
6983     return (tmp___0);   7059     return (tmp___0);
6984   }   7060   }
6985 }   7061 }
6986 }   7062 }
6987 Bool vgDrd_bm_load_4_has_conflict_with(struct bitmap * const  bm ,   7063 Bool vgDrd_bm_load_4_has_conflict_with(struct bitmap * const  bm ,
6988                                        Addr const   a1 )   7064                                        Addr const   a1 )
6989 {   7065 {
6990   Bool tmp ;   7066   Bool tmp ;
6991   Bool tmp___0 ;   7067   Bool tmp___0 ;
6992     7068  
6993   {   7069   {
6994   if ((a1 & 3UL) == 0UL) {   7070   if ((a1 & 3UL) == 0UL) {
6995     tmp = bm_aligned_load_has_conflict_with(bm, a1, (SizeT const   )4);   7071     tmp = bm_aligned_load_has_conflict_with(bm, a1, (SizeT const   )4);
6996     return (tmp);   7072     return (tmp);
6997   } else {   7073   } else {
6998     tmp___0 = vgDrd_bm_has_conflict_with(bm, a1, a1 + 4UL,   7074     tmp___0 = vgDrd_bm_has_conflict_with(bm, a1, a1 + 4UL,
6999                                          (BmAccessTypeT const   )0);   7075                                          (BmAccessTypeT const   )0);
7000     return (tmp___0);   7076     return (tmp___0);
7001   }   7077   }
7002 }   7078 }
7003 }   7079 }
7004 Bool vgDrd_bm_load_8_has_conflict_with(struct bitmap * const  bm ,   7080 Bool vgDrd_bm_load_8_has_conflict_with(struct bitmap * const  bm ,
7005                                        Addr const   a1 )   7081                                        Addr const   a1 )
7006 {   7082 {
7007   Bool tmp ;   7083   Bool tmp ;
7008   Bool tmp___0 ;   7084   Bool tmp___0 ;
7009     7085  
7010   {   7086   {
7011   if ((a1 & 7UL) == 0UL) {   7087   if ((a1 & 7UL) == 0UL) {
7012     tmp = bm_aligned_load_has_conflict_with(bm, a1, (SizeT const   )8);   7088     tmp = bm_aligned_load_has_conflict_with(bm, a1, (SizeT const   )8);
7013     return (tmp);   7089     return (tmp);
7014   } else {   7090   } else {
7015     tmp___0 = vgDrd_bm_has_conflict_with(bm, a1, a1 + 8UL,   7091     tmp___0 = vgDrd_bm_has_conflict_with(bm, a1, a1 + 8UL,
7016                                          (BmAccessTypeT const   )0);   7092                                          (BmAccessTypeT const   )0);
7017     return (tmp___0);   7093     return (tmp___0);
7018   }   7094   }
7019 }   7095 }
7020 }   7096 }
7021 Bool vgDrd_bm_store_1_has_conflict_with(struct bitmap * const  bm ,   7097 Bool vgDrd_bm_store_1_has_conflict_with(struct bitmap * const  bm ,
7022                                         Addr const   a1 )   7098                                         Addr const   a1 )
7023 {   7099 {
7024   Bool tmp ;   7100   Bool tmp ;
7025     7101  
7026   {   7102   {
7027   tmp = bm_aligned_store_has_conflict_with(bm, a1, (SizeT const   )1);   7103   tmp = bm_aligned_store_has_conflict_with(bm, a1, (SizeT const   )1);
7028   return (tmp);   7104   return (tmp);
7029 }   7105 }
7030 }   7106 }
7031 Bool vgDrd_bm_store_2_has_conflict_with(struct bitmap * const  bm ,   7107 Bool vgDrd_bm_store_2_has_conflict_with(struct bitmap * const  bm ,
7032                                         Addr const   a1 )   7108                                         Addr const   a1 )
7033 {   7109 {
7034   Bool tmp ;   7110   Bool tmp ;
7035   Bool tmp___0 ;   7111   Bool tmp___0 ;
7036     7112  
7037   {   7113   {
7038   if ((a1 & 1UL) == 0UL) {   7114   if ((a1 & 1UL) == 0UL) {
7039     tmp = bm_aligned_store_has_conflict_with(bm, a1, (SizeT const   )2);   7115     tmp = bm_aligned_store_has_conflict_with(bm, a1, (SizeT const   )2);
7040     return (tmp);   7116     return (tmp);
7041   } else {   7117   } else {
7042     tmp___0 = vgDrd_bm_has_conflict_with(bm, a1, a1 + 2UL,   7118     tmp___0 = vgDrd_bm_has_conflict_with(bm, a1, a1 + 2UL,
7043                                          (BmAccessTypeT const   )1);   7119                                          (BmAccessTypeT const   )1);
7044     return (tmp___0);   7120     return (tmp___0);
7045   }   7121   }
7046 }   7122 }
7047 }   7123 }
7048 Bool vgDrd_bm_store_4_has_conflict_with(struct bitmap * const  bm ,   7124 Bool vgDrd_bm_store_4_has_conflict_with(struct bitmap * const  bm ,
7049                                         Addr const   a1 )   7125                                         Addr const   a1 )
7050 {   7126 {
7051   Bool tmp ;   7127   Bool tmp ;
7052   Bool tmp___0 ;   7128   Bool tmp___0 ;
7053     7129  
7054   {   7130   {
7055   if ((a1 & 3UL) == 0UL) {   7131   if ((a1 & 3UL) == 0UL) {
7056     tmp = bm_aligned_store_has_conflict_with(bm, a1, (SizeT const   )4);   7132     tmp = bm_aligned_store_has_conflict_with(bm, a1, (SizeT const   )4);
7057     return (tmp);   7133     return (tmp);
7058   } else {   7134   } else {
7059     tmp___0 = vgDrd_bm_has_conflict_with(bm, a1, a1 + 4UL,   7135     tmp___0 = vgDrd_bm_has_conflict_with(bm, a1, a1 + 4UL,
7060                                          (BmAccessTypeT const   )1);   7136                                          (BmAccessTypeT const   )1);
7061     return (tmp___0);   7137     return (tmp___0);
7062   }   7138   }
7063 }   7139 }
7064 }   7140 }
7065 Bool vgDrd_bm_store_8_has_conflict_with(struct bitmap * const  bm ,   7141 Bool vgDrd_bm_store_8_has_conflict_with(struct bitmap * const  bm ,
7066                                         Addr const   a1 )   7142                                         Addr const   a1 )
7067 {   7143 {
7068   Bool tmp ;   7144   Bool tmp ;
7069   Bool tmp___0 ;   7145   Bool tmp___0 ;
7070     7146  
7071   {   7147   {
7072   if ((a1 & 7UL) == 0UL) {   7148   if ((a1 & 7UL) == 0UL) {
7073     tmp = bm_aligned_store_has_conflict_with(bm, a1, (SizeT const   )8);   7149     tmp = bm_aligned_store_has_conflict_with(bm, a1, (SizeT const   )8);
7074     return (tmp);   7150     return (tmp);
7075   } else {   7151   } else {
7076     tmp___0 = vgDrd_bm_has_conflict_with(bm, a1, a1 + 8UL,   7152     tmp___0 = vgDrd_bm_has_conflict_with(bm, a1, a1 + 8UL,
7077                                          (BmAccessTypeT const   )1);   7153                                          (BmAccessTypeT const   )1);
7078     return (tmp___0);   7154     return (tmp___0);
7079   }   7155   }
7080 }   7156 }
7081 }   7157 }
7082 Bool vgDrd_bm_store_has_conflict_with(struct bitmap * const  bm ,   7158 Bool vgDrd_bm_store_has_conflict_with(struct bitmap * const  bm ,
7083                                       Addr const   a1 , Addr const   a2 )   7159                                       Addr const   a1 , Addr const   a2 )
7084 {   7160 {
7085   Bool tmp ;   7161   Bool tmp ;
7086     7162  
7087   {   7163   {
7088   tmp = vgDrd_bm_has_conflict_with(bm, a1, a2, (BmAccessTypeT const   )1);   7164   tmp = vgDrd_bm_has_conflict_with(bm, a1, a2, (BmAccessTypeT const   )1);
7089   return (tmp);   7165   return (tmp);
7090 }   7166 }
7091 }   7167 }
7092 Bool vgDrd_bm_equal(struct bitmap * const  lhs , struct bitmap * const  rhs )   7168 Bool vgDrd_bm_equal(struct bitmap * const  lhs , struct bitmap * const  rhs )
7093 {   7169 {
7094   struct bitmap2 *bm2l ;   7170   struct bitmap2 *bm2l ;
7095   struct bitmap2 *bm2r ;   7171   struct bitmap2 *bm2r ;
7096   long tmp ;   7172   long tmp ;
7097   void *tmp___0 ;   7173   void *tmp___0 ;
7098   Addr tmp___1 ;   7174   Addr tmp___1 ;
7099   Addr tmp___2 ;   7175   Addr tmp___2 ;
7100   Bool tmp___3 ;   7176   Bool tmp___3 ;
7101   long tmp___4 ;   7177   long tmp___4 ;
7102   void *tmp___5 ;   7178   void *tmp___5 ;
7103   Addr tmp___6 ;   7179   Addr tmp___6 ;
7104   Addr tmp___7 ;   7180   Addr tmp___7 ;
7105   Bool tmp___8 ;   7181   Bool tmp___8 ;
7106   long tmp___9 ;   7182   long tmp___9 ;
7107   Addr tmp___10 ;   7183   Addr tmp___10 ;
7108   Addr tmp___11 ;   7184   Addr tmp___11 ;
7109   Bool tmp___12 ;   7185   Bool tmp___12 ;
7110   int tmp___13 ;   7186   int tmp___13 ;
7111   long tmp___14 ;   7187   long tmp___14 ;
7112   Int tmp___15 ;   7188   Int tmp___15 ;
7113   void *tmp___16 ;   7189   void *tmp___16 ;
7114   void *tmp___17 ;   7190   void *tmp___17 ;
7115   Addr tmp___18 ;   7191   Addr tmp___18 ;
7116   Addr tmp___19 ;   7192   Addr tmp___19 ;
7117   Bool tmp___20 ;   7193   Bool tmp___20 ;
7118   Addr tmp___21 ;   7194   Addr tmp___21 ;
7119   Addr tmp___22 ;   7195   Addr tmp___22 ;
7120   Bool tmp___23 ;   7196   Bool tmp___23 ;
7121   int tmp___24 ;   7197   int tmp___24 ;
7122   long tmp___25 ;   7198   long tmp___25 ;
7123     7199  
7124   {   7200   {
7125   tmp = __builtin_expect((long )(! (! ((unsigned int )lhs != (unsigned int )rhs))),   7201   tmp = __builtin_expect((long )(! (! ((unsigned int )lhs != (unsigned int )rhs))),
7126                          1L);   7202                          1L);
7127   if (tmp) {   7203   if (tmp) {
7128     7204  
7129   } else {   7205   } else {
7130     vgPlain_assert_fail((Bool )0, (Char const   *)"lhs != rhs",   7206     vgPlain_assert_fail((Bool )0, (Char const   *)"lhs != rhs",
7131                         (Char const   *)"drd_bitmap.c", 955,   7207                         (Char const   *)"drd_bitmap.c", 955,
7132                         (Char const   *)"vgDrd_bm_equal", "");   7208                         (Char const   *)"vgDrd_bm_equal", "");
7133   }   7209   }
7134   vgPlain_OSetGen_ResetIter(lhs->oset);   7210   vgPlain_OSetGen_ResetIter(lhs->oset);
7135   vgPlain_OSetGen_ResetIter(rhs->oset);   7211   vgPlain_OSetGen_ResetIter(rhs->oset);
7136   while (1) {   7212   while (1) {
7137     tmp___16 = vgPlain_OSetGen_Next(lhs->oset);   7213     tmp___16 = vgPlain_OSetGen_Next(lhs->oset);
7138     bm2l = (struct bitmap2 *)tmp___16;   7214     bm2l = (struct bitmap2 *)tmp___16;
7139     if ((unsigned int )bm2l != (unsigned int )((struct bitmap2 *)0)) {   7215     if ((unsigned int )bm2l != (unsigned int )((struct bitmap2 *)0)) {
7140     7216  
7141     } else {   7217     } else {
7142       break;   7218       break;
7143     }   7219     }
7144     while (1) {   7220     while (1) {
7145       if (bm2l) {   7221       if (bm2l) {
7146         tmp___1 = make_address((UWord const   )(bm2l->addr + 1UL),   7222         tmp___1 = make_address((UWord const   )(bm2l->addr + 1UL),
7147                                (UWord const   )0);   7223                                (UWord const   )0);
7148         tmp___2 = make_address((UWord const   )bm2l->addr, (UWord const   )0);   7224         tmp___2 = make_address((UWord const   )bm2l->addr, (UWord const   )0);
7149         tmp___3 = vgDrd_bm_has_any_access(lhs, (Addr const   )tmp___2,   7225         tmp___3 = vgDrd_bm_has_any_access(lhs, (Addr const   )tmp___2,
7150                                           (Addr const   )tmp___1);   7226                                           (Addr const   )tmp___1);
7151         if (tmp___3) {   7227         if (tmp___3) {
7152           break;   7228           break;
7153         } else {   7229         } else {
7154     7230  
7155         }   7231         }
7156       } else {   7232       } else {
7157         break;   7233         break;
7158       }   7234       }
7159       tmp___0 = vgPlain_OSetGen_Next(lhs->oset);   7235       tmp___0 = vgPlain_OSetGen_Next(lhs->oset);
7160       bm2l = (struct bitmap2 *)tmp___0;   7236       bm2l = (struct bitmap2 *)tmp___0;
7161     }   7237     }
7162     if ((unsigned int )bm2l == (unsigned int )((struct bitmap2 *)0)) {   7238     if ((unsigned int )bm2l == (unsigned int )((struct bitmap2 *)0)) {
7163       break;   7239       break;
7164     } else {   7240     } else {
7165     7241  
7166     }   7242     }
7167     tmp___4 = __builtin_expect((long )(! (! bm2l)), 1L);   7243     tmp___4 = __builtin_expect((long )(! (! bm2l)), 1L);
7168     if (tmp___4) {   7244     if (tmp___4) {
7169     7245  
7170     } else {   7246     } else {
7171       vgPlain_assert_fail((Bool )0, (Char const   *)"bm2l",   7247       vgPlain_assert_fail((Bool )0, (Char const   *)"bm2l",
7172                           (Char const   *)"drd_bitmap.c", 971,   7248                           (Char const   *)"drd_bitmap.c", 971,
7173                           (Char const   *)"vgDrd_bm_equal", "");   7249                           (Char const   *)"vgDrd_bm_equal", "");
7174     }   7250     }
7175     while (1) {   7251     while (1) {
7176       tmp___5 = vgPlain_OSetGen_Next(rhs->oset);   7252       tmp___5 = vgPlain_OSetGen_Next(rhs->oset);
7177       bm2r = (struct bitmap2 *)tmp___5;   7253       bm2r = (struct bitmap2 *)tmp___5;
7178       if ((unsigned int )bm2r == (unsigned int )((struct bitmap2 *)0)) {   7254       if ((unsigned int )bm2r == (unsigned int )((struct bitmap2 *)0)) {
7179         return ((Bool )0);   7255         return ((Bool )0);
7180       } else {   7256       } else {
7181     7257  
7182       }   7258       }
7183       tmp___6 = make_address((UWord const   )(bm2r->addr + 1UL),   7259       tmp___6 = make_address((UWord const   )(bm2r->addr + 1UL),
7184                              (UWord const   )0);   7260                              (UWord const   )0);
7185       tmp___7 = make_address((UWord const   )bm2r->addr, (UWord const   )0);   7261       tmp___7 = make_address((UWord const   )bm2r->addr, (UWord const   )0);
7186       tmp___8 = vgDrd_bm_has_any_access(rhs, (Addr const   )tmp___7,   7262       tmp___8 = vgDrd_bm_has_any_access(rhs, (Addr const   )tmp___7,
7187                                         (Addr const   )tmp___6);   7263                                         (Addr const   )tmp___6);
7188       if (tmp___8) {   7264       if (tmp___8) {
7189         break;   7265         break;
7190       } else {   7266       } else {
7191     7267  
7192       }   7268       }
7193     }   7269     }
7194     tmp___9 = __builtin_expect((long )(! (! bm2r)), 1L);   7270     tmp___9 = __builtin_expect((long )(! (! bm2r)), 1L);
7195     if (tmp___9) {   7271     if (tmp___9) {
7196     7272  
7197     } else {   7273     } else {
7198       vgPlain_assert_fail((Bool )0, (Char const   *)"bm2r",   7274       vgPlain_assert_fail((Bool )0, (Char const   *)"bm2r",
7199                           (Char const   *)"drd_bitmap.c", 983,   7275                           (Char const   *)"drd_bitmap.c", 983,
7200                           (Char const   *)"vgDrd_bm_equal", "");   7276                           (Char const   *)"vgDrd_bm_equal", "");
7201     }   7277     }
7202     tmp___10 = make_address((UWord const   )(bm2r->addr + 1UL),   7278     tmp___10 = make_address((UWord const   )(bm2r->addr + 1UL),
7203                             (UWord const   )0);   7279                             (UWord const   )0);
7204     tmp___11 = make_address((UWord const   )bm2r->addr, (UWord const   )0);   7280     tmp___11 = make_address((UWord const   )bm2r->addr, (UWord const   )0);
7205     tmp___12 = vgDrd_bm_has_any_access(rhs, (Addr const   )tmp___11,   7281     tmp___12 = vgDrd_bm_has_any_access(rhs, (Addr const   )tmp___11,
7206                                        (Addr const   )tmp___10);   7282                                        (Addr const   )tmp___10);
7207     if (tmp___12) {   7283     if (tmp___12) {
7208       tmp___13 = 1;   7284       tmp___13 = 1;
7209     } else {   7285     } else {
7210       tmp___13 = 0;   7286       tmp___13 = 0;
7211     }   7287     }
7212     tmp___14 = __builtin_expect((long )tmp___13, 1L);   7288     tmp___14 = __builtin_expect((long )tmp___13, 1L);
7213     if (tmp___14) {   7289     if (tmp___14) {
7214     7290  
7215     } else {   7291     } else {
7216       vgPlain_assert_fail((Bool )0,   7292       vgPlain_assert_fail((Bool )0,
7217                           (Char const   *)"DRD_(bm_has_any_access)(rhs, make_address(bm2r->addr, 0), make_address(bm2r->addr + 1, 0))",   7293                           (Char const   *)"DRD_(bm_has_any_access)(rhs, make_address(bm2r->addr, 0), make_address(bm2r->addr + 1, 0))",
7218                           (Char const   *)"drd_bitmap.c", 986,   7294                           (Char const   *)"drd_bitmap.c", 986,
7219                           (Char const   *)"vgDrd_bm_equal", "");   7295                           (Char const   *)"vgDrd_bm_equal", "");
7220     }   7296     }
7221     if ((unsigned int )bm2l != (unsigned int )bm2r) {   7297     if ((unsigned int )bm2l != (unsigned int )bm2r) {
7222       if (bm2l->addr != bm2r->addr) {   7298       if (bm2l->addr != bm2r->addr) {
7223         return ((Bool )0);   7299         return ((Bool )0);
7224       } else {   7300       } else {
7225         tmp___15 = vgPlain_memcmp((void const   *)(& bm2l->bm1),   7301         tmp___15 = vgPlain_memcmp((void const   *)(& bm2l->bm1),
7226                                   (void const   *)(& bm2r->bm1),   7302                                   (void const   *)(& bm2r->bm1),
7227                                   (SizeT )sizeof(bm2l->bm1));   7303                                   (SizeT )sizeof(bm2l->bm1));
7228         if (tmp___15 != 0) {   7304         if (tmp___15 != 0) {
7229           return ((Bool )0);   7305           return ((Bool )0);
7230         } else {   7306         } else {
7231     7307  
7232         }   7308         }
7233       }   7309       }
7234     } else {   7310     } else {
7235     7311  
7236     }   7312     }
7237   }   7313   }
7238   while (1) {   7314   while (1) {
7239     tmp___17 = vgPlain_OSetGen_Next(rhs->oset);   7315     tmp___17 = vgPlain_OSetGen_Next(rhs->oset);
7240     bm2r = (struct bitmap2 *)tmp___17;   7316     bm2r = (struct bitmap2 *)tmp___17;
7241     if (bm2r) {   7317     if (bm2r) {
7242       tmp___18 = make_address((UWord const   )(bm2r->addr + 1UL),   7318       tmp___18 = make_address((UWord const   )(bm2r->addr + 1UL),
7243                               (UWord const   )0);   7319                               (UWord const   )0);
7244       tmp___19 = make_address((UWord const   )bm2r->addr, (UWord const   )0);   7320       tmp___19 = make_address((UWord const   )bm2r->addr, (UWord const   )0);
7245       tmp___20 = vgDrd_bm_has_any_access(rhs, (Addr const   )tmp___19,   7321       tmp___20 = vgDrd_bm_has_any_access(rhs, (Addr const   )tmp___19,
7246                                          (Addr const   )tmp___18);   7322                                          (Addr const   )tmp___18);
7247       if (tmp___20) {   7323       if (tmp___20) {
7248         break;   7324         break;
7249       } else {   7325       } else {
7250     7326  
7251       }   7327       }
7252     } else {   7328     } else {
7253       break;   7329       break;
7254     }   7330     }
7255   }   7331   }
7256   if (bm2r) {   7332   if (bm2r) {
7257     tmp___21 = make_address((UWord const   )(bm2r->addr + 1UL),   7333     tmp___21 = make_address((UWord const   )(bm2r->addr + 1UL),
7258                             (UWord const   )0);   7334                             (UWord const   )0);
7259     tmp___22 = make_address((UWord const   )bm2r->addr, (UWord const   )0);   7335     tmp___22 = make_address((UWord const   )bm2r->addr, (UWord const   )0);
7260     tmp___23 = vgDrd_bm_has_any_access(rhs, (Addr const   )tmp___22,   7336     tmp___23 = vgDrd_bm_has_any_access(rhs, (Addr const   )tmp___22,
7261                                        (Addr const   )tmp___21);   7337                                        (Addr const   )tmp___21);
7262     if (tmp___23) {   7338     if (tmp___23) {
7263       tmp___24 = 1;   7339       tmp___24 = 1;
7264     } else {   7340     } else {
7265       tmp___24 = 0;   7341       tmp___24 = 0;
7266     }   7342     }
7267     tmp___25 = __builtin_expect((long )tmp___24, 1L);   7343     tmp___25 = __builtin_expect((long )tmp___24, 1L);
7268     if (tmp___25) {   7344     if (tmp___25) {
7269     7345  
7270     } else {   7346     } else {
7271       vgPlain_assert_fail((Bool )0,   7347       vgPlain_assert_fail((Bool )0,
7272                           (Char const   *)"DRD_(bm_has_any_access)(rhs, make_address(bm2r->addr, 0), make_address(bm2r->addr + 1, 0))",   7348                           (Char const   *)"DRD_(bm_has_any_access)(rhs, make_address(bm2r->addr, 0), make_address(bm2r->addr + 1, 0))",
7273                           (Char const   *)"drd_bitmap.c", 1006,   7349                           (Char const   *)"drd_bitmap.c", 1006,
7274                           (Char const   *)"vgDrd_bm_equal", "");   7350                           (Char const   *)"vgDrd_bm_equal", "");
7275     }   7351     }
7276     return ((Bool )0);   7352     return ((Bool )0);
7277   } else {   7353   } else {
7278     7354  
7279   }   7355   }
7280   return ((Bool )1);   7356   return ((Bool )1);
7281 }   7357 }
7282 }   7358 }
7283 void vgDrd_bm_swap(struct bitmap * const  bm1 , struct bitmap * const  bm2 )   7359 void vgDrd_bm_swap(struct bitmap * const  bm1 , struct bitmap * const  bm2 )
7284 {   7360 {
7285   OSet *tmp ;   7361   OSet *tmp ;
7286     7362  
7287   {   7363   {
7288   tmp = bm1->oset;   7364   tmp = bm1->oset;
7289   bm1->oset = bm2->oset;   7365   bm1->oset = bm2->oset;
7290   bm2->oset = tmp;   7366   bm2->oset = tmp;
7291   return;   7367   return;
7292 }   7368 }
7293 }   7369 }
7294 void vgDrd_bm_merge2(struct bitmap * const  lhs , struct bitmap * const  rhs )   7370 void vgDrd_bm_merge2(struct bitmap * const  lhs , struct bitmap * const  rhs )
7295 {   7371 {
7296   struct bitmap2 *bm2l ;   7372   struct bitmap2 *bm2l ;
7297   struct bitmap2 *bm2r ;   7373   struct bitmap2 *bm2r ;
7298   long tmp ;   7374   long tmp ;
7299   void *tmp___0 ;   7375   void *tmp___0 ;
7300   long tmp___1 ;   7376   long tmp___1 ;
7301   void *tmp___2 ;   7377   void *tmp___2 ;
7302     7378  
7303   {   7379   {
7304   tmp = __builtin_expect((long )(! (! ((unsigned int )lhs != (unsigned int )rhs))),   7380   tmp = __builtin_expect((long )(! (! ((unsigned int )lhs != (unsigned int )rhs))),
7305                          1L);   7381                          1L);
7306   if (tmp) {   7382   if (tmp) {
7307     7383  
7308   } else {   7384   } else {
7309     vgPlain_assert_fail((Bool )0, (Char const   *)"lhs != rhs",   7385     vgPlain_assert_fail((Bool )0, (Char const   *)"lhs != rhs",
7310                         (Char const   *)"drd_bitmap.c", 1029,   7386                         (Char const   *)"drd_bitmap.c", 1029,
7311                         (Char const   *)"vgDrd_bm_merge2", "");   7387                         (Char const   *)"vgDrd_bm_merge2", "");
7312   }   7388   }
7313   s_bitmap_merge_count ++;   7389   s_bitmap_merge_count ++;
7314   vgPlain_OSetGen_ResetIter(rhs->oset);   7390   vgPlain_OSetGen_ResetIter(rhs->oset);
7315   while (1) {   7391   while (1) {
7316     tmp___2 = vgPlain_OSetGen_Next(rhs->oset);   7392     tmp___2 = vgPlain_OSetGen_Next(rhs->oset);
7317     bm2r = (struct bitmap2 *)tmp___2;   7393     bm2r = (struct bitmap2 *)tmp___2;
7318     if ((unsigned int )bm2r != (unsigned int )((struct bitmap2 *)0)) {   7394     if ((unsigned int )bm2r != (unsigned int )((struct bitmap2 *)0)) {
7319     7395  
7320     } else {   7396     } else {
7321       break;   7397       break;
7322     }   7398     }
7323     tmp___0 = vgPlain_OSetGen_Lookup((OSet const   *)lhs->oset,   7399     tmp___0 = vgPlain_OSetGen_Lookup((OSet const   *)lhs->oset,
7324                                      (void const   *)(& bm2r->addr));   7400                                      (void const   *)(& bm2r->addr));
7325     bm2l = (struct bitmap2 *)tmp___0;   7401     bm2l = (struct bitmap2 *)tmp___0;
7326     if (bm2l) {   7402     if (bm2l) {
7327       tmp___1 = __builtin_expect((long )(! (! ((unsigned int )bm2l != (unsigned int )bm2r))),   7403       tmp___1 = __builtin_expect((long )(! (! ((unsigned int )bm2l != (unsigned int )bm2r))),
7328                                  1L);   7404                                  1L);
7329       if (tmp___1) {   7405       if (tmp___1) {
7330     7406  
7331       } else {   7407       } else {
7332         vgPlain_assert_fail((Bool )0, (Char const   *)"bm2l != bm2r",   7408         vgPlain_assert_fail((Bool )0, (Char const   *)"bm2l != bm2r",
7333                             (Char const   *)"drd_bitmap.c", 1040,   7409                             (Char const   *)"drd_bitmap.c", 1040,
7334                             (Char const   *)"vgDrd_bm_merge2", "");   7410                             (Char const   *)"vgDrd_bm_merge2", "");
7335       }   7411       }
7336       bm2_merge((struct bitmap2 */* const  */)bm2l,   7412       bm2_merge((struct bitmap2 */* const  */)bm2l,
7337                 (struct bitmap2  const  */* const  */)bm2r);   7413                 (struct bitmap2  const  */* const  */)bm2r);
7338     } else {   7414     } else {
7339       bm2_insert_copy(lhs, (struct bitmap2 */* const  */)bm2r);   7415       bm2_insert_copy(lhs, (struct bitmap2 */* const  */)bm2r);
7340     }   7416     }
7341   }   7417   }
7342   return;   7418   return;
7343 }   7419 }
7344 }   7420 }
7345 void vgDrd_bm_unmark(struct bitmap *bm )   7421 void vgDrd_bm_unmark(struct bitmap *bm )
7346 {   7422 {
7347   struct bitmap2 *bm2 ;   7423   struct bitmap2 *bm2 ;
7348   void *tmp ;   7424   void *tmp ;
7349     7425  
7350   {   7426   {
7351   vgPlain_OSetGen_ResetIter(bm->oset);   7427   vgPlain_OSetGen_ResetIter(bm->oset);
7352   while (1) {   7428   while (1) {
7353     tmp = vgPlain_OSetGen_Next(bm->oset);   7429     tmp = vgPlain_OSetGen_Next(bm->oset);
7354     bm2 = (struct bitmap2 *)tmp;   7430     bm2 = (struct bitmap2 *)tmp;
7355     if ((unsigned int )bm2 != (unsigned int )((struct bitmap2 *)0)) {   7431     if ((unsigned int )bm2 != (unsigned int )((struct bitmap2 *)0)) {
7356     7432  
7357     } else {   7433     } else {
7358       break;   7434       break;
7359     }   7435     }
7360     bm2->recalc = (Bool )0;   7436     bm2->recalc = (Bool )0;
7361   }   7437   }
7362   return;   7438   return;
7363 }   7439 }
7364 }   7440 }
7365 Bool vgDrd_bm_is_marked(struct bitmap *bm , Addr const   a )   7441 Bool vgDrd_bm_is_marked(struct bitmap *bm , Addr const   a )
7366 {   7442 {
7367   struct bitmap2  const  *bm2 ;   7443   struct bitmap2  const  *bm2 ;
7368   int tmp ;   7444   int tmp ;
7369     7445  
7370   {   7446   {
7371   bm2 = bm2_lookup((struct bitmap */* const  */)bm, a);   7447   bm2 = bm2_lookup((struct bitmap */* const  */)bm, a);
7372   if (bm2) {   7448   if (bm2) {
7373     if (bm2->recalc) {   7449     if (bm2->recalc) {
7374       tmp = 1;   7450       tmp = 1;
7375     } else {   7451     } else {
7376       tmp = 0;   7452       tmp = 0;
7377     }   7453     }
7378   } else {   7454   } else {
7379     tmp = 0;   7455     tmp = 0;
7380   }   7456   }
7381   return ((Bool )tmp);   7457   return ((Bool )tmp);
7382 }   7458 }
7383 }   7459 }
7384 void vgDrd_bm_mark(struct bitmap *bml , struct bitmap *bmr )   7460 void vgDrd_bm_mark(struct bitmap *bml , struct bitmap *bmr )
7385 {   7461 {
7386   struct bitmap2 *bm2l ;   7462   struct bitmap2 *bm2l ;
7387   struct bitmap2 *bm2r ;   7463   struct bitmap2 *bm2r ;
7388   void *tmp ;   7464   void *tmp ;
7389     7465  
7390   {   7466   {
7391   vgPlain_OSetGen_ResetIter(bmr->oset);   7467   vgPlain_OSetGen_ResetIter(bmr->oset);
7392   while (1) {   7468   while (1) {
7393     tmp = vgPlain_OSetGen_Next(bmr->oset);   7469     tmp = vgPlain_OSetGen_Next(bmr->oset);
7394     bm2r = (struct bitmap2 *)tmp;   7470     bm2r = (struct bitmap2 *)tmp;
7395     if ((unsigned int )bm2r != (unsigned int )((struct bitmap2 *)0)) {   7471     if ((unsigned int )bm2r != (unsigned int )((struct bitmap2 *)0)) {
7396     7472  
7397     } else {   7473     } else {
7398       break;   7474       break;
7399     }   7475     }
7400     bm2l = bm2_lookup_or_insert((struct bitmap */* const  */)bml,   7476     bm2l = bm2_lookup_or_insert((struct bitmap */* const  */)bml,
7401                                 (UWord const   )bm2r->addr);   7477                                 (UWord const   )bm2r->addr);
7402     bm2l->recalc = (Bool )1;   7478     bm2l->recalc = (Bool )1;
7403   }   7479   }
7404   return;   7480   return;
7405 }   7481 }
7406 }   7482 }
7407 void vgDrd_bm_clear_marked(struct bitmap *bm )   7483 void vgDrd_bm_clear_marked(struct bitmap *bm )
7408 {   7484 {
7409   struct bitmap2 *bm2 ;   7485   struct bitmap2 *bm2 ;
7410   void *tmp ;   7486   void *tmp ;
7411     7487  
7412   {   7488   {
7413   vgPlain_OSetGen_ResetIter(bm->oset);   7489   vgPlain_OSetGen_ResetIter(bm->oset);
7414   while (1) {   7490   while (1) {
7415     tmp = vgPlain_OSetGen_Next(bm->oset);   7491     tmp = vgPlain_OSetGen_Next(bm->oset);
7416     bm2 = (struct bitmap2 *)tmp;   7492     bm2 = (struct bitmap2 *)tmp;
7417     if ((unsigned int )bm2 != (unsigned int )((struct bitmap2 *)0)) {   7493     if ((unsigned int )bm2 != (unsigned int )((struct bitmap2 *)0)) {
7418     7494  
7419     } else {   7495     } else {
7420       break;   7496       break;
7421     }   7497     }
7422     if (bm2->recalc) {   7498     if (bm2->recalc) {
7423       bm2_clear((struct bitmap2 */* const  */)bm2);   7499       bm2_clear((struct bitmap2 */* const  */)bm2);
7424     } else {   7500     } else {
7425     7501  
7426     }   7502     }
7427   }   7503   }
7428   return;   7504   return;
7429 }   7505 }
7430 }   7506 }
7431 void vgDrd_bm_merge2_marked(struct bitmap * const  lhs ,   7507 void vgDrd_bm_merge2_marked(struct bitmap * const  lhs ,
7432                             struct bitmap * const  rhs )   7508                             struct bitmap * const  rhs )
7433 {   7509 {
7434   struct bitmap2 *bm2l ;   7510   struct bitmap2 *bm2l ;
7435   struct bitmap2 *bm2r ;   7511   struct bitmap2 *bm2r ;
7436   long tmp ;   7512   long tmp ;
7437   void *tmp___0 ;   7513   void *tmp___0 ;
7438   long tmp___1 ;   7514   long tmp___1 ;
7439   void *tmp___2 ;   7515   void *tmp___2 ;
7440     7516  
7441   {   7517   {
7442   tmp = __builtin_expect((long )(! (! ((unsigned int )lhs != (unsigned int )rhs))),   7518   tmp = __builtin_expect((long )(! (! ((unsigned int )lhs != (unsigned int )rhs))),
7443                          1L);   7519                          1L);
7444   if (tmp) {   7520   if (tmp) {
7445     7521  
7446   } else {   7522   } else {
7447     vgPlain_assert_fail((Bool )0, (Char const   *)"lhs != rhs",   7523     vgPlain_assert_fail((Bool )0, (Char const   *)"lhs != rhs",
7448                         (Char const   *)"drd_bitmap.c", 1120,   7524                         (Char const   *)"drd_bitmap.c", 1120,
7449                         (Char const   *)"vgDrd_bm_merge2_marked", "");   7525                         (Char const   *)"vgDrd_bm_merge2_marked", "");
7450   }   7526   }
7451   s_bitmap_merge_count ++;   7527   s_bitmap_merge_count ++;
7452   vgPlain_OSetGen_ResetIter(rhs->oset);   7528   vgPlain_OSetGen_ResetIter(rhs->oset);
7453   while (1) {   7529   while (1) {
7454     tmp___2 = vgPlain_OSetGen_Next(rhs->oset);   7530     tmp___2 = vgPlain_OSetGen_Next(rhs->oset);
7455     bm2r = (struct bitmap2 *)tmp___2;   7531     bm2r = (struct bitmap2 *)tmp___2;
7456     if ((unsigned int )bm2r != (unsigned int )((struct bitmap2 *)0)) {   7532     if ((unsigned int )bm2r != (unsigned int )((struct bitmap2 *)0)) {
7457     7533  
7458     } else {   7534     } else {
7459       break;   7535       break;
7460     }   7536     }
7461     tmp___0 = vgPlain_OSetGen_Lookup((OSet const   *)lhs->oset,   7537     tmp___0 = vgPlain_OSetGen_Lookup((OSet const   *)lhs->oset,
7462                                      (void const   *)(& bm2r->addr));   7538                                      (void const   *)(& bm2r->addr));
7463     bm2l = (struct bitmap2 *)tmp___0;   7539     bm2l = (struct bitmap2 *)tmp___0;
7464     if (bm2l) {   7540     if (bm2l) {
7465       if (bm2l->recalc) {   7541       if (bm2l->recalc) {
7466         tmp___1 = __builtin_expect((long )(! (! ((unsigned int )bm2l != (unsigned int )bm2r))),   7542         tmp___1 = __builtin_expect((long )(! (! ((unsigned int )bm2l != (unsigned int )bm2r))),
7467                                    1L);   7543                                    1L);
7468         if (tmp___1) {   7544         if (tmp___1) {
7469     7545  
7470         } else {   7546         } else {
7471           vgPlain_assert_fail((Bool )0, (Char const   *)"bm2l != bm2r",   7547           vgPlain_assert_fail((Bool )0, (Char const   *)"bm2l != bm2r",
7472                               (Char const   *)"drd_bitmap.c", 1131,   7548                               (Char const   *)"drd_bitmap.c", 1131,
7473                               (Char const   *)"vgDrd_bm_merge2_marked", "");   7549                               (Char const   *)"vgDrd_bm_merge2_marked", "");
7474         }   7550         }
7475         bm2_merge((struct bitmap2 */* const  */)bm2l,   7551         bm2_merge((struct bitmap2 */* const  */)bm2l,
7476                   (struct bitmap2  const  */* const  */)bm2r);   7552                   (struct bitmap2  const  */* const  */)bm2r);
7477       } else {   7553       } else {
7478     7554  
7479       }   7555       }
7480     } else {   7556     } else {
7481     7557  
7482     }   7558     }
7483   }   7559   }
7484   return;   7560   return;
7485 }   7561 }
7486 }   7562 }
7487 void vgDrd_bm_remove_cleared_marked(struct bitmap *bm )   7563 void vgDrd_bm_remove_cleared_marked(struct bitmap *bm )
7488 {   7564 {
7489   struct bitmap2 *bm2 ;   7565   struct bitmap2 *bm2 ;
7490   UWord a1 ;   7566   UWord a1 ;
7491   Addr tmp ;   7567   Addr tmp ;
7492   Addr tmp___0 ;   7568   Addr tmp___0 ;
7493   Bool tmp___1 ;   7569   Bool tmp___1 ;
7494   void *tmp___2 ;   7570   void *tmp___2 ;
7495     7571  
7496   {   7572   {
7497   vgPlain_OSetGen_ResetIter(bm->oset);   7573   vgPlain_OSetGen_ResetIter(bm->oset);
7498   while (1) {   7574   while (1) {
7499     tmp___2 = vgPlain_OSetGen_Next(bm->oset);   7575     tmp___2 = vgPlain_OSetGen_Next(bm->oset);
7500     bm2 = (struct bitmap2 *)tmp___2;   7576     bm2 = (struct bitmap2 *)tmp___2;
7501     if ((unsigned int )bm2 != (unsigned int )((struct bitmap2 *)0)) {   7577     if ((unsigned int )bm2 != (unsigned int )((struct bitmap2 *)0)) {
7502     7578  
7503     } else {   7579     } else {
7504       break;   7580       break;
7505     }   7581     }
7506     a1 = bm2->addr;   7582     a1 = bm2->addr;
7507     if (bm2->recalc) {   7583     if (bm2->recalc) {
7508       tmp = make_address((UWord const   )(a1 + 1UL), (UWord const   )0);   7584       tmp = make_address((UWord const   )(a1 + 1UL), (UWord const   )0);
7509       tmp___0 = make_address((UWord const   )a1, (UWord const   )0);   7585       tmp___0 = make_address((UWord const   )a1, (UWord const   )0);
7510       tmp___1 = vgDrd_bm_has_any_access((struct bitmap */* const  */)bm,   7586       tmp___1 = vgDrd_bm_has_any_access((struct bitmap */* const  */)bm,
7511                                         (Addr const   )tmp___0,   7587                                         (Addr const   )tmp___0,
7512                                         (Addr const   )tmp);   7588                                         (Addr const   )tmp);
7513       if (tmp___1) {   7589       if (tmp___1) {
7514     7590  
7515       } else {   7591       } else {
7516         bm2_remove((struct bitmap */* const  */)bm, (UWord const   )a1);   7592         bm2_remove((struct bitmap */* const  */)bm, (UWord const   )a1);
7517         vgPlain_OSetGen_ResetIterAt(bm->oset, (void const   *)(& a1));   7593         vgPlain_OSetGen_ResetIterAt(bm->oset, (void const   *)(& a1));
7518       }   7594       }
7519     } else {   7595     } else {
7520     7596  
7521     }   7597     }
7522   }   7598   }
7523   return;   7599   return;
7524 }   7600 }
7525 }   7601 }
7526 int vgDrd_bm_has_races(struct bitmap * const  lhs , struct bitmap * const  rhs )   7602 int vgDrd_bm_has_races(struct bitmap * const  lhs , struct bitmap * const  rhs )
7527 {   7603 {
7528   struct bitmap2  const  *bm2l ;   7604   struct bitmap2  const  *bm2l ;
7529   struct bitmap2  const  *bm2r ;   7605   struct bitmap2  const  *bm2r ;
7530   struct bitmap1  const  *bm1l ;   7606   struct bitmap1  const  *bm1l ;
7531   struct bitmap1  const  *bm1r ;   7607   struct bitmap1  const  *bm1r ;
7532   unsigned int k ;   7608   unsigned int k ;
7533   void *tmp ;   7609   void *tmp ;
7534   void *tmp___0 ;   7610   void *tmp___0 ;
7535   void *tmp___1 ;   7611   void *tmp___1 ;
7536   void *tmp___2 ;   7612   void *tmp___2 ;
7537   unsigned int b ;   7613   unsigned int b ;
7538   UWord access_mask ;   7614   UWord access_mask ;
7539   UWord tmp___3 ;   7615   UWord tmp___3 ;
7540   int tmp___4 ;   7616   int tmp___4 ;
7541   UWord tmp___5 ;   7617   UWord tmp___5 ;
7542   UWord tmp___6 ;   7618   UWord tmp___6 ;
7543   int tmp___7 ;   7619   int tmp___7 ;
7544   UWord tmp___8 ;   7620   UWord tmp___8 ;
7545   UWord tmp___9 ;   7621   UWord tmp___9 ;
7546   int tmp___10 ;   7622   int tmp___10 ;
7547   UWord tmp___11 ;   7623   UWord tmp___11 ;
7548   UWord tmp___12 ;   7624   UWord tmp___12 ;
7549   int tmp___13 ;   7625   int tmp___13 ;
7550   UWord tmp___14 ;   7626   UWord tmp___14 ;
7551   Addr a ;   7627   Addr a ;
7552   Addr tmp___15 ;   7628   Addr tmp___15 ;
7553   Bool tmp___16 ;   7629   Bool tmp___16 ;
7554     7630  
7555   {   7631   {
7556   vgPlain_OSetGen_ResetIter(lhs->oset);   7632   vgPlain_OSetGen_ResetIter(lhs->oset);
7557   vgPlain_OSetGen_ResetIter(rhs->oset);   7633   vgPlain_OSetGen_ResetIter(rhs->oset);
7558   while (1) {   7634   while (1) {
7559     tmp = vgPlain_OSetGen_Next(lhs->oset);   7635     tmp = vgPlain_OSetGen_Next(lhs->oset);
7560     bm2l = (struct bitmap2  const  *)tmp;   7636     bm2l = (struct bitmap2  const  *)tmp;
7561     tmp___0 = vgPlain_OSetGen_Next(rhs->oset);   7637     tmp___0 = vgPlain_OSetGen_Next(rhs->oset);
7562     bm2r = (struct bitmap2  const  *)tmp___0;   7638     bm2r = (struct bitmap2  const  *)tmp___0;
7563     while (1) {   7639     while (1) {
7564       if (bm2l) {   7640       if (bm2l) {
7565         if (bm2r) {   7641         if (bm2r) {
7566           if (bm2l->addr != bm2r->addr) {   7642           if (bm2l->addr != bm2r->addr) {
7567     7643  
7568           } else {   7644           } else {
7569             break;   7645             break;
7570           }   7646           }
7571         } else {   7647         } else {
7572           break;   7648           break;
7573         }   7649         }
7574       } else {   7650       } else {
7575         break;   7651         break;
7576       }   7652       }
7577       if (bm2l->addr < bm2r->addr) {   7653       if (bm2l->addr < bm2r->addr) {
7578         tmp___1 = vgPlain_OSetGen_Next(lhs->oset);   7654         tmp___1 = vgPlain_OSetGen_Next(lhs->oset);
7579         bm2l = (struct bitmap2  const  *)tmp___1;   7655         bm2l = (struct bitmap2  const  *)tmp___1;
7580       } else {   7656       } else {
7581         tmp___2 = vgPlain_OSetGen_Next(rhs->oset);   7657         tmp___2 = vgPlain_OSetGen_Next(rhs->oset);
7582         bm2r = (struct bitmap2  const  *)tmp___2;   7658         bm2r = (struct bitmap2  const  *)tmp___2;
7583       }   7659       }
7584     }   7660     }
7585     if ((unsigned int )bm2l == (unsigned int )((struct bitmap2  const  *)0)) {   7661     if ((unsigned int )bm2l == (unsigned int )((struct bitmap2  const  *)0)) {
7586       break;   7662       break;
7587     } else   7663     } else
7588     if ((unsigned int )bm2r == (unsigned int )((struct bitmap2  const  *)0)) {   7664     if ((unsigned int )bm2r == (unsigned int )((struct bitmap2  const  *)0)) {
7589       break;   7665       break;
7590     } else {   7666     } else {
7591     7667  
7592     }   7668     }
7593     bm1l = & bm2l->bm1;   7669     bm1l = & bm2l->bm1;
7594     bm1r = & bm2r->bm1;   7670     bm1r = & bm2r->bm1;
7595     k = 0U;   7671     k = 0U;
7596     while (k < 1U << 7) {   7672     while (k < 1U << 7) {
7597       b = 0U;   7673       b = 0U;
7598       while (b < 8U * sizeof(UWord )) {   7674       while (b < 8U * sizeof(UWord )) {
7599         tmp___5 = bm0_mask((UWord const   )b);   7675         tmp___5 = bm0_mask((UWord const   )b);
7600         if (bm1l->bm0_r[k] & tmp___5) {   7676         if (bm1l->bm0_r[k] & tmp___5) {
7601           tmp___4 = 1;   7677           tmp___4 = 1;
7602         } else {   7678         } else {
7603           tmp___4 = 0;   7679           tmp___4 = 0;
7604         }   7680         }
7605         tmp___8 = bm0_mask((UWord const   )b);   7681         tmp___8 = bm0_mask((UWord const   )b);
7606         if (bm1l->bm0_w[k] & tmp___8) {   7682         if (bm1l->bm0_w[k] & tmp___8) {
7607           tmp___7 = 1 << 1;   7683           tmp___7 = 1 << 1;
7608         } else {   7684         } else {
7609           tmp___7 = 0;   7685           tmp___7 = 0;
7610         }   7686         }
7611         tmp___11 = bm0_mask((UWord const   )b);   7687         tmp___11 = bm0_mask((UWord const   )b);
7612         if (bm1r->bm0_r[k] & tmp___11) {   7688         if (bm1r->bm0_r[k] & tmp___11) {
7613           tmp___10 = 1 << 2;   7689           tmp___10 = 1 << 2;
7614         } else {   7690         } else {
7615           tmp___10 = 0;   7691           tmp___10 = 0;
7616         }   7692         }
7617         tmp___14 = bm0_mask((UWord const   )b);   7693         tmp___14 = bm0_mask((UWord const   )b);
7618         if (bm1r->bm0_w[k] & tmp___14) {   7694         if (bm1r->bm0_w[k] & tmp___14) {
7619           tmp___13 = 1 << 3;   7695           tmp___13 = 1 << 3;
7620         } else {   7696         } else {
7621           tmp___13 = 0;   7697           tmp___13 = 0;
7622         }   7698         }
7623         access_mask = (UWord )(((tmp___4 | tmp___7) | tmp___10) | tmp___13);   7699         access_mask = (UWord )(((tmp___4 | tmp___7) | tmp___10) | tmp___13);
7624         tmp___15 = make_address(bm2l->addr,   7700         tmp___15 = make_address(bm2l->addr,
7625                                 (UWord const   )(k * (8U * sizeof(UWord )) | b));   7701                                 (UWord const   )(k * (8U * sizeof(UWord )) | b));
7626         a = tmp___15;   7702         a = tmp___15;
7627         if (access_mask & (unsigned long )(1 << 3)) {   7703         if (access_mask & (unsigned long )(1 << 3)) {
7628           if (access_mask & (unsigned long )(1 | (1 << 1))) {   7704           if (access_mask & (unsigned long )(1 | (1 << 1))) {
7629             goto _L;   7705             goto _L;
7630           } else {   7706           } else {
7631             goto _L___0;   7707             goto _L___0;
7632           }   7708           }
7633         } else   7709         } else
7634         _L___0: /* CIL Label */   7710         _L___0: /* CIL Label */
7635         if (access_mask & (unsigned long )(1 << 1)) {   7711         if (access_mask & (unsigned long )(1 << 1)) {
7636           if (access_mask & (unsigned long )((1 << 2) | (1 << 3))) {   7712           if (access_mask & (unsigned long )((1 << 2) | (1 << 3))) {
7637             _L: /* CIL Label */   7713             _L: /* CIL Label */
7638             tmp___16 = vgDrd_is_suppressed((Addr const   )a,   7714             tmp___16 = vgDrd_is_suppressed((Addr const   )a,
7639                                            (Addr const   )(a + 1UL));   7715                                            (Addr const   )(a + 1UL));
7640             if (tmp___16) {   7716             if (tmp___16) {
7641     7717  
7642             } else {   7718             } else {
7643               return (1);   7719               return (1);
7644             }   7720             }
7645           } else {   7721           } else {
7646     7722  
7647           }   7723           }
7648         } else {   7724         } else {
7649     7725  
7650         }   7726         }
7651         b ++;   7727         b ++;
7652       }   7728       }
7653       k ++;   7729       k ++;
7654     }   7730     }
7655   }   7731   }
7656   return (0);   7732   return (0);
7657 }   7733 }
7658 }   7734 }
7659 void vgDrd_bm_print(struct bitmap * const  bm )   7735 void vgDrd_bm_print(struct bitmap * const  bm )
7660 {   7736 {
7661   struct bitmap2 *bm2 ;   7737   struct bitmap2 *bm2 ;
7662   void *tmp ;   7738   void *tmp ;
7663     7739  
7664   {   7740   {
7665   vgPlain_OSetGen_ResetIter(bm->oset);   7741   vgPlain_OSetGen_ResetIter(bm->oset);
7666   while (1) {   7742   while (1) {
7667     tmp = vgPlain_OSetGen_Next(bm->oset);   7743     tmp = vgPlain_OSetGen_Next(bm->oset);
7668     bm2 = (struct bitmap2 *)tmp;   7744     bm2 = (struct bitmap2 *)tmp;
7669     if ((unsigned int )bm2 != (unsigned int )((struct bitmap2 *)0)) {   7745     if ((unsigned int )bm2 != (unsigned int )((struct bitmap2 *)0)) {
7670     7746  
7671     } else {   7747     } else {
7672       break;   7748       break;
7673     }   7749     }
7674     bm2_print((struct bitmap2  const  */* const  */)bm2);   7750     bm2_print((struct bitmap2  const  */* const  */)bm2);
7675   }   7751   }
7676   return;   7752   return;
7677 }   7753 }
7678 }   7754 }
7679 static void bm2_print(struct bitmap2  const  * const  bm2 )   7755 static void bm2_print(struct bitmap2  const  * const  bm2 )
7680 {   7756 {
7681   struct bitmap1  const  *bm1 ;   7757   struct bitmap1  const  *bm1 ;
7682   Addr a ;   7758   Addr a ;
7683   long tmp ;   7759   long tmp ;
7684   Bool r ;   7760   Bool r ;
7685   UWord tmp___0 ;   7761   UWord tmp___0 ;
7686   UWord tmp___1 ;   7762   UWord tmp___1 ;
7687   Bool w ;   7763   Bool w ;
7688   UWord tmp___2 ;   7764   UWord tmp___2 ;
7689   UWord tmp___3 ;   7765   UWord tmp___3 ;
7690   int tmp___4 ;   7766   int tmp___4 ;
7691   int tmp___5 ;   7767   int tmp___5 ;
7692   Addr tmp___6 ;   7768   Addr tmp___6 ;
7693     7769  
7694   {   7770   {
7695   tmp = __builtin_expect((long )(! (! bm2)), 1L);   7771   tmp = __builtin_expect((long )(! (! bm2)), 1L);
7696   if (tmp) {   7772   if (tmp) {
7697     7773  
7698   } else {   7774   } else {
7699     vgPlain_assert_fail((Bool )0, (Char const   *)"bm2",   7775     vgPlain_assert_fail((Bool )0, (Char const   *)"bm2",
7700                         (Char const   *)"drd_bitmap.c", 1228,   7776                         (Char const   *)"drd_bitmap.c", 1228,
7701                         (Char const   *)"bm2_print", "");   7777                         (Char const   *)"bm2_print", "");
7702   }   7778   }
7703   bm1 = & bm2->bm1;   7779   bm1 = & bm2->bm1;
7704   a = make_address(bm2->addr, (UWord const   )0);   7780   a = make_address(bm2->addr, (UWord const   )0);
7705   while (1) {   7781   while (1) {
7706     tmp___6 = make_address(bm2->addr + 1UL, (UWord const   )0);   7782     tmp___6 = make_address(bm2->addr + 1UL, (UWord const   )0);
7707     if (a <= tmp___6 - 1UL) {   7783     if (a <= tmp___6 - 1UL) {
7708     7784  
7709     } else {   7785     } else {
7710       break;   7786       break;
7711     }   7787     }
7712     tmp___0 = address_lsb((Addr const   )a);   7788     tmp___0 = address_lsb((Addr const   )a);
7713     tmp___1 = bm0_is_set((UWord const   *)(bm1->bm0_r), (UWord const   )tmp___0);   7789     tmp___1 = bm0_is_set((UWord const   *)(bm1->bm0_r), (UWord const   )tmp___0);
7714     r = (Bool )(tmp___1 != 0UL);   7790     r = (Bool )(tmp___1 != 0UL);
7715     tmp___2 = address_lsb((Addr const   )a);   7791     tmp___2 = address_lsb((Addr const   )a);
7716     tmp___3 = bm0_is_set((UWord const   *)(bm1->bm0_w), (UWord const   )tmp___2);   7792     tmp___3 = bm0_is_set((UWord const   *)(bm1->bm0_w), (UWord const   )tmp___2);
7717     w = (Bool )(tmp___3 != 0UL);   7793     w = (Bool )(tmp___3 != 0UL);
7718     if (r) {   7794     if (r) {
7719       goto _L;   7795       goto _L;
7720     } else   7796     } else
7721     if (w) {   7797     if (w) {
7722       _L: /* CIL Label */   7798       _L: /* CIL Label */
7723       if (r) {   7799       if (r) {
7724         tmp___4 = 'R';   7800         tmp___4 = 'R';
7725       } else {   7801       } else {
7726         tmp___4 = ' ';   7802         tmp___4 = ' ';
7727       }   7803       }
7728       if (w) {   7804       if (w) {
7729         tmp___5 = 'W';   7805         tmp___5 = 'W';
7730       } else {   7806       } else {
7731         tmp___5 = ' ';   7807         tmp___5 = ' ';
7732       }   7808       }
7733       vgPlain_printf("0x%08lx %c %c\n", a, tmp___5, tmp___4);   7809       vgPlain_printf("0x%08lx %c %c\n", a, tmp___5, tmp___4);
7734     } else {   7810     } else {
7735     7811  
7736     }   7812     }
7737     a ++;   7813     a ++;
7738   }   7814   }
7739   return;   7815   return;
7740 }   7816 }
7741 }   7817 }
7742 ULong vgDrd_bm_get_bitmap_creation_count(void)   7818 ULong vgDrd_bm_get_bitmap_creation_count(void)
7743 {   7819 {
7744     7820  
7745     7821  
7746   {   7822   {
7747   return (s_bitmap_creation_count);   7823   return (s_bitmap_creation_count);
7748 }   7824 }
7749 }   7825 }
7750 ULong vgDrd_bm_get_bitmap2_creation_count(void)   7826 ULong vgDrd_bm_get_bitmap2_creation_count(void)
7751 {   7827 {
7752     7828  
7753     7829  
7754   {   7830   {
7755   return (s_bitmap2_creation_count);   7831   return (s_bitmap2_creation_count);
7756 }   7832 }
7757 }   7833 }
7758 ULong vgDrd_bm_get_bitmap2_merge_count(void)   7834 ULong vgDrd_bm_get_bitmap2_merge_count(void)
7759 {   7835 {
7760     7836  
7761     7837  
7762   {   7838   {
7763   return (s_bitmap2_merge_count);   7839   return (s_bitmap2_merge_count);
7764 }   7840 }
7765 }   7841 }
7766 static void bm2_merge(struct bitmap2 * const  bm2l ,   7842 static void bm2_merge(struct bitmap2 * const  bm2l ,
7767                       struct bitmap2  const  * const  bm2r )   7843                       struct bitmap2  const  * const  bm2r )
7768 {   7844 {
7769   unsigned int k ;   7845   unsigned int k ;
7770   long tmp ;   7846   long tmp ;
7771   long tmp___0 ;   7847   long tmp___0 ;
7772   long tmp___1 ;   7848   long tmp___1 ;
7773     7849  
7774   {   7850   {
7775   tmp = __builtin_expect((long )(! (! bm2l)), 1L);   7851   tmp = __builtin_expect((long )(! (! bm2l)), 1L);
7776   if (tmp) {   7852   if (tmp) {
7777     7853  
7778   } else {   7854   } else {
7779     vgPlain_assert_fail((Bool )0, (Char const   *)"bm2l",   7855     vgPlain_assert_fail((Bool )0, (Char const   *)"bm2l",
7780                         (Char const   *)"drd_bitmap.c", 1268,   7856                         (Char const   *)"drd_bitmap.c", 1268,
7781                         (Char const   *)"bm2_merge", "");   7857                         (Char const   *)"bm2_merge", "");
7782   }   7858   }
7783   tmp___0 = __builtin_expect((long )(! (! bm2r)), 1L);   7859   tmp___0 = __builtin_expect((long )(! (! bm2r)), 1L);
7784   if (tmp___0) {   7860   if (tmp___0) {
7785     7861  
7786   } else {   7862   } else {
7787     vgPlain_assert_fail((Bool )0, (Char const   *)"bm2r",   7863     vgPlain_assert_fail((Bool )0, (Char const   *)"bm2r",
7788                         (Char const   *)"drd_bitmap.c", 1269,   7864                         (Char const   *)"drd_bitmap.c", 1269,
7789                         (Char const   *)"bm2_merge", "");   7865                         (Char const   *)"bm2_merge", "");
7790   }   7866   }
7791   tmp___1 = __builtin_expect((long )(! (! (bm2l->addr == (Addr )bm2r->addr))),   7867   tmp___1 = __builtin_expect((long )(! (! (bm2l->addr == (Addr )bm2r->addr))),
7792                              1L);   7868                              1L);
7793   if (tmp___1) {   7869   if (tmp___1) {
7794     7870  
7795   } else {   7871   } else {
7796     vgPlain_assert_fail((Bool )0, (Char const   *)"bm2l->addr == bm2r->addr",   7872     vgPlain_assert_fail((Bool )0, (Char const   *)"bm2l->addr == bm2r->addr",
7797                         (Char const   *)"drd_bitmap.c", 1270,   7873                         (Char const   *)"drd_bitmap.c", 1270,
7798                         (Char const   *)"bm2_merge", "");   7874                         (Char const   *)"bm2_merge", "");
7799   }   7875   }
7800   s_bitmap2_merge_count ++;   7876   s_bitmap2_merge_count ++;
7801   k = 0U;   7877   k = 0U;
7802   while (k < 1U << 7) {   7878   while (k < 1U << 7) {
7803     bm2l->bm1.bm0_r[k] |= bm2r->bm1.bm0_r[k];   7879     bm2l->bm1.bm0_r[k] |= bm2r->bm1.bm0_r[k];
7804     k ++;   7880     k ++;
7805   }   7881   }
7806   k = 0U;   7882   k = 0U;
7807   while (k < 1U << 7) {   7883   while (k < 1U << 7) {
7808     bm2l->bm1.bm0_w[k] |= bm2r->bm1.bm0_w[k];   7884     bm2l->bm1.bm0_w[k] |= bm2r->bm1.bm0_w[k];
7809     k ++;   7885     k ++;
7810   }   7886   }
7811   return;   7887   return;
7812 }   7888 }
7813 }   7889 }
7814 extern void ppIRType(IRType  ) ;   7890 extern void ppIRType(IRType  ) ;
7815 extern Int sizeofIRType(IRType  ) ;   7891 extern Int sizeofIRType(IRType  ) ;
7816 extern IRConst *IRConst_U1(Bool  ) ;   7892 extern IRConst *IRConst_U1(Bool  ) ;
7817 extern IRConst *IRConst_U8(UChar  ) ;   7893 extern IRConst *IRConst_U8(UChar  ) ;
7818 extern IRConst *IRConst_U16(UShort  ) ;   7894 extern IRConst *IRConst_U16(UShort  ) ;
7819 extern IRConst *IRConst_U32(UInt  ) ;   7895 extern IRConst *IRConst_U32(UInt  ) ;
7820 extern IRConst *IRConst_U64(ULong  ) ;   7896 extern IRConst *IRConst_U64(ULong  ) ;
7821 extern IRConst *IRConst_F32(Float  ) ;   7897 extern IRConst *IRConst_F32(Float  ) ;
7822 extern IRConst *IRConst_F32i(UInt  ) ;   7898 extern IRConst *IRConst_F32i(UInt  ) ;
7823 extern IRConst *IRConst_F64(Double  ) ;   7899 extern IRConst *IRConst_F64(Double  ) ;
7824 extern IRConst *IRConst_F64i(ULong  ) ;   7900 extern IRConst *IRConst_F64i(ULong  ) ;
7825 extern IRConst *IRConst_V128(UShort  ) ;   7901 extern IRConst *IRConst_V128(UShort  ) ;
7826 extern IRConst *deepCopyIRConst(IRConst * ) ;   7902 extern IRConst *deepCopyIRConst(IRConst * ) ;
7827 extern void ppIRConst(IRConst * ) ;   7903 extern void ppIRConst(IRConst * ) ;
7828 extern Bool eqIRConst(IRConst * , IRConst * ) ;   7904 extern Bool eqIRConst(IRConst * , IRConst * ) ;
7829 extern IRCallee *mkIRCallee(Int regparms , HChar *name , void *addr ) ;   7905 extern IRCallee *mkIRCallee(Int regparms , HChar *name , void *addr ) ;
7830 extern IRCallee *deepCopyIRCallee(IRCallee * ) ;   7906 extern IRCallee *deepCopyIRCallee(IRCallee * ) ;
7831 extern void ppIRCallee(IRCallee * ) ;   7907 extern void ppIRCallee(IRCallee * ) ;
7832 extern IRRegArray *mkIRRegArray(Int  , IRType  , Int  ) ;   7908 extern IRRegArray *mkIRRegArray(Int  , IRType  , Int  ) ;
7833 extern IRRegArray *deepCopyIRRegArray(IRRegArray * ) ;   7909 extern IRRegArray *deepCopyIRRegArray(IRRegArray * ) ;
7834 extern void ppIRRegArray(IRRegArray * ) ;   7910 extern void ppIRRegArray(IRRegArray * ) ;
7835 extern Bool eqIRRegArray(IRRegArray * , IRRegArray * ) ;   7911 extern Bool eqIRRegArray(IRRegArray * , IRRegArray * ) ;
7836 extern void ppIRTemp(IRTemp  ) ;   7912 extern void ppIRTemp(IRTemp  ) ;
7837 extern void ppIROp(IROp  ) ;   7913 extern void ppIROp(IROp  ) ;
7838 extern IRExpr *IRExpr_Binder(Int binder ) ;   7914 extern IRExpr *IRExpr_Binder(Int binder ) ;
7839 extern IRExpr *IRExpr_Get(Int off , IRType ty ) ;   7915 extern IRExpr *IRExpr_Get(Int off , IRType ty ) ;
7840 extern IRExpr *IRExpr_GetI(IRRegArray *descr , IRExpr *ix , Int bias ) ;   7916 extern IRExpr *IRExpr_GetI(IRRegArray *descr , IRExpr *ix , Int bias ) ;
7841 extern IRExpr *IRExpr_RdTmp(IRTemp tmp ) ;   7917 extern IRExpr *IRExpr_RdTmp(IRTemp tmp ) ;
7842 extern IRExpr *IRExpr_Qop(IROp op , IRExpr *arg1 , IRExpr *arg2 , IRExpr *arg3 ,   7918 extern IRExpr *IRExpr_Qop(IROp op , IRExpr *arg1 , IRExpr *arg2 , IRExpr *arg3 ,
7843                           IRExpr *arg4 ) ;   7919                           IRExpr *arg4 ) ;
7844 extern IRExpr *IRExpr_Triop(IROp op , IRExpr *arg1 , IRExpr *arg2 ,   7920 extern IRExpr *IRExpr_Triop(IROp op , IRExpr *arg1 , IRExpr *arg2 ,
7845                             IRExpr *arg3 ) ;   7921                             IRExpr *arg3 ) ;
7846 extern IRExpr *IRExpr_Binop(IROp op , IRExpr *arg1 , IRExpr *arg2 ) ;   7922 extern IRExpr *IRExpr_Binop(IROp op , IRExpr *arg1 , IRExpr *arg2 ) ;
7847 extern IRExpr *IRExpr_Unop(IROp op , IRExpr *arg ) ;   7923 extern IRExpr *IRExpr_Unop(IROp op , IRExpr *arg ) ;
7848 extern IRExpr *IRExpr_Load(IREndness end , IRType ty , IRExpr *addr ) ;   7924 extern IRExpr *IRExpr_Load(IREndness end , IRType ty , IRExpr *addr ) ;
7849 extern IRExpr *IRExpr_Const(IRConst *con ) ;   7925 extern IRExpr *IRExpr_Const(IRConst *con ) ;
7850 extern IRExpr *IRExpr_CCall(IRCallee *cee , IRType retty , IRExpr **args ) ;   7926 extern IRExpr *IRExpr_CCall(IRCallee *cee , IRType retty , IRExpr **args ) ;
7851 extern IRExpr *IRExpr_Mux0X(IRExpr *cond , IRExpr *expr0 , IRExpr *exprX ) ;   7927 extern IRExpr *IRExpr_Mux0X(IRExpr *cond , IRExpr *expr0 , IRExpr *exprX ) ;
7852 extern IRExpr *deepCopyIRExpr(IRExpr * ) ;   7928 extern IRExpr *deepCopyIRExpr(IRExpr * ) ;
7853 extern void ppIRExpr(IRExpr * ) ;   7929 extern void ppIRExpr(IRExpr * ) ;
7854 extern IRExpr **mkIRExprVec_0(void) ;   7930 extern IRExpr **mkIRExprVec_0(void) ;
7855 extern IRExpr **mkIRExprVec_1(IRExpr * ) ;   7931 extern IRExpr **mkIRExprVec_1(IRExpr * ) ;
7856 extern IRExpr **mkIRExprVec_2(IRExpr * , IRExpr * ) ;   7932 extern IRExpr **mkIRExprVec_2(IRExpr * , IRExpr * ) ;
7857 extern IRExpr **mkIRExprVec_3(IRExpr * , IRExpr * , IRExpr * ) ;   7933 extern IRExpr **mkIRExprVec_3(IRExpr * , IRExpr * , IRExpr * ) ;
7858 extern IRExpr **mkIRExprVec_4(IRExpr * , IRExpr * , IRExpr * , IRExpr * ) ;   7934 extern IRExpr **mkIRExprVec_4(IRExpr * , IRExpr * , IRExpr * , IRExpr * ) ;
7859 extern IRExpr **mkIRExprVec_5(IRExpr * , IRExpr * , IRExpr * , IRExpr * ,   7935 extern IRExpr **mkIRExprVec_5(IRExpr * , IRExpr * , IRExpr * , IRExpr * ,
7860                               IRExpr * ) ;   7936                               IRExpr * ) ;
7861 extern IRExpr **mkIRExprVec_6(IRExpr * , IRExpr * , IRExpr * , IRExpr * ,   7937 extern IRExpr **mkIRExprVec_6(IRExpr * , IRExpr * , IRExpr * , IRExpr * ,
7862                               IRExpr * , IRExpr * ) ;   7938                               IRExpr * , IRExpr * ) ;
7863 extern IRExpr **mkIRExprVec_7(IRExpr * , IRExpr * , IRExpr * , IRExpr * ,   7939 extern IRExpr **mkIRExprVec_7(IRExpr * , IRExpr * , IRExpr * , IRExpr * ,
7864                               IRExpr * , IRExpr * , IRExpr * ) ;   7940                               IRExpr * , IRExpr * , IRExpr * ) ;
7865 extern IRExpr **mkIRExprVec_8(IRExpr * , IRExpr * , IRExpr * , IRExpr * ,   7941 extern IRExpr **mkIRExprVec_8(IRExpr * , IRExpr * , IRExpr * , IRExpr * ,
7866                               IRExpr * , IRExpr * , IRExpr * , IRExpr * ) ;   7942                               IRExpr * , IRExpr * , IRExpr * , IRExpr * ) ;
7867 extern IRExpr **shallowCopyIRExprVec(IRExpr ** ) ;   7943 extern IRExpr **shallowCopyIRExprVec(IRExpr ** ) ;
7868 extern IRExpr **deepCopyIRExprVec(IRExpr ** ) ;   7944 extern IRExpr **deepCopyIRExprVec(IRExpr ** ) ;
7869 extern IRExpr *mkIRExpr_HWord(HWord  ) ;   7945 extern IRExpr *mkIRExpr_HWord(HWord  ) ;
7870 extern IRExpr *mkIRExprCCall(IRType retty , Int regparms , HChar *name ,   7946 extern IRExpr *mkIRExprCCall(IRType retty , Int regparms , HChar *name ,
7871                              void *addr , IRExpr **args ) ;   7947                              void *addr , IRExpr **args ) ;
7872 __inline static Bool isIRAtom(IRExpr *e )   7948 __inline static Bool isIRAtom(IRExpr *e )
7873 {   7949 {
7874   int tmp ;   7950   int tmp ;
7875   Bool tmp___0 ;   7951   Bool tmp___0 ;
7876     7952  
7877   {   7953   {
7878   if ((unsigned int )e->tag == 86019U) {   7954   if ((unsigned int )e->tag == 86019U) {
7879     tmp = 1;   7955     tmp = 1;
7880   } else   7956   } else
7881   if ((unsigned int )e->tag == 86025U) {   7957   if ((unsigned int )e->tag == 86025U) {
7882     tmp = 1;   7958     tmp = 1;
7883   } else {   7959   } else {
7884     tmp = 0;   7960     tmp = 0;
7885   }   7961   }
7886   tmp___0 = toBool(tmp);   7962   tmp___0 = toBool(tmp);
7887   return (tmp___0);   7963   return (tmp___0);
7888 }   7964 }
7889 }   7965 }
7890 extern Bool eqIRAtom(IRExpr * , IRExpr * ) ;   7966 extern Bool eqIRAtom(IRExpr * , IRExpr * ) ;
7891 extern void ppIRJumpKind(IRJumpKind  ) ;   7967 extern void ppIRJumpKind(IRJumpKind  ) ;
7892 extern void ppIREffect(IREffect  ) ;   7968 extern void ppIREffect(IREffect  ) ;
7893 extern void ppIRDirty(IRDirty * ) ;   7969 extern void ppIRDirty(IRDirty * ) ;
7894 extern IRDirty *emptyIRDirty(void) ;   7970 extern IRDirty *emptyIRDirty(void) ;
7895 extern IRDirty *deepCopyIRDirty(IRDirty * ) ;   7971 extern IRDirty *deepCopyIRDirty(IRDirty * ) ;
7896 extern IRDirty *unsafeIRDirty_0_N(Int regparms , HChar *name , void *addr ,   7972 extern IRDirty *unsafeIRDirty_0_N(Int regparms , HChar *name , void *addr ,
7897                                   IRExpr **args ) ;   7973                                   IRExpr **args ) ;
7898 extern IRDirty *unsafeIRDirty_1_N(IRTemp dst , Int regparms , HChar *name ,   7974 extern IRDirty *unsafeIRDirty_1_N(IRTemp dst , Int regparms , HChar *name ,
7899                                   void *addr , IRExpr **args ) ;   7975                                   void *addr , IRExpr **args ) ;
7900 extern void ppIRMBusEvent(IRMBusEvent  ) ;   7976 extern void ppIRMBusEvent(IRMBusEvent  ) ;
7901 extern void ppIRCAS(IRCAS *cas ) ;   7977 extern void ppIRCAS(IRCAS *cas ) ;
7902 extern IRCAS *mkIRCAS(IRTemp oldHi , IRTemp oldLo , IREndness end ,   7978 extern IRCAS *mkIRCAS(IRTemp oldHi , IRTemp oldLo , IREndness end ,
7903                       IRExpr *addr , IRExpr *expdHi , IRExpr *expdLo ,   7979                       IRExpr *addr , IRExpr *expdHi , IRExpr *expdLo ,
7904                       IRExpr *dataHi , IRExpr *dataLo ) ;   7980                       IRExpr *dataHi , IRExpr *dataLo ) ;
7905 extern IRCAS *deepCopyIRCAS(IRCAS * ) ;   7981 extern IRCAS *deepCopyIRCAS(IRCAS * ) ;
7906 extern IRStmt *IRStmt_NoOp(void) ;   7982 extern IRStmt *IRStmt_NoOp(void) ;
7907 extern IRStmt *IRStmt_IMark(Addr64 addr , Int len , UChar delta ) ;   7983 extern IRStmt *IRStmt_IMark(Addr64 addr , Int len , UChar delta ) ;
7908 extern IRStmt *IRStmt_AbiHint(IRExpr *base , Int len , IRExpr *nia ) ;   7984 extern IRStmt *IRStmt_AbiHint(IRExpr *base , Int len , IRExpr *nia ) ;
7909 extern IRStmt *IRStmt_Put(Int off , IRExpr *data ) ;   7985 extern IRStmt *IRStmt_Put(Int off , IRExpr *data ) ;
7910 extern IRStmt *IRStmt_PutI(IRRegArray *descr , IRExpr *ix , Int bias ,   7986 extern IRStmt *IRStmt_PutI(IRRegArray *descr , IRExpr *ix , Int bias ,
7911                            IRExpr *data ) ;   7987                            IRExpr *data ) ;
7912 extern IRStmt *IRStmt_WrTmp(IRTemp tmp , IRExpr *data ) ;   7988 extern IRStmt *IRStmt_WrTmp(IRTemp tmp , IRExpr *data ) ;
7913 extern IRStmt *IRStmt_Store(IREndness end , IRExpr *addr , IRExpr *data ) ;   7989 extern IRStmt *IRStmt_Store(IREndness end , IRExpr *addr , IRExpr *data ) ;
7914 extern IRStmt *IRStmt_CAS(IRCAS *details ) ;   7990 extern IRStmt *IRStmt_CAS(IRCAS *details ) ;
7915 extern IRStmt *IRStmt_LLSC(IREndness end , IRTemp result , IRExpr *addr ,   7991 extern IRStmt *IRStmt_LLSC(IREndness end , IRTemp result , IRExpr *addr ,
7916                            IRExpr *storedata ) ;   7992                            IRExpr *storedata ) ;
7917 extern IRStmt *IRStmt_Dirty(IRDirty *details ) ;   7993 extern IRStmt *IRStmt_Dirty(IRDirty *details ) ;
7918 extern IRStmt *IRStmt_MBE(IRMBusEvent event ) ;   7994 extern IRStmt *IRStmt_MBE(IRMBusEvent event ) ;
7919 extern IRStmt *IRStmt_Exit(IRExpr *guard , IRJumpKind jk , IRConst *dst ) ;   7995 extern IRStmt *IRStmt_Exit(IRExpr *guard , IRJumpKind jk , IRConst *dst ) ;
7920 extern IRStmt *deepCopyIRStmt(IRStmt * ) ;   7996 extern IRStmt *deepCopyIRStmt(IRStmt * ) ;
7921 extern void ppIRStmt(IRStmt * ) ;   7997 extern void ppIRStmt(IRStmt * ) ;
7922 extern IRTemp newIRTemp(IRTypeEnv * , IRType  ) ;   7998 extern IRTemp newIRTemp(IRTypeEnv * , IRType  ) ;
7923 extern IRTypeEnv *deepCopyIRTypeEnv(IRTypeEnv * ) ;   7999 extern IRTypeEnv *deepCopyIRTypeEnv(IRTypeEnv * ) ;
7924 extern void ppIRTypeEnv(IRTypeEnv * ) ;   8000 extern void ppIRTypeEnv(IRTypeEnv * ) ;
7925 extern IRSB *emptyIRSB(void) ;   8001 extern IRSB *emptyIRSB(void) ;
7926 extern IRSB *deepCopyIRSB(IRSB * ) ;   8002 extern IRSB *deepCopyIRSB(IRSB * ) ;
7927 extern IRSB *deepCopyIRSBExceptStmts(IRSB * ) ;   8003 extern IRSB *deepCopyIRSBExceptStmts(IRSB * ) ;
7928 extern void ppIRSB(IRSB * ) ;   8004 extern void ppIRSB(IRSB * ) ;
7929 extern void addStmtToIRSB(IRSB * , IRStmt * ) ;   8005 extern void addStmtToIRSB(IRSB * , IRStmt * ) ;
7930 extern IRTypeEnv *emptyIRTypeEnv(void) ;   8006 extern IRTypeEnv *emptyIRTypeEnv(void) ;
7931 extern IRType typeOfIRConst(IRConst * ) ;   8007 extern IRType typeOfIRConst(IRConst * ) ;
7932 extern IRType typeOfIRTemp(IRTypeEnv * , IRTemp  ) ;   8008 extern IRType typeOfIRTemp(IRTypeEnv * , IRTemp  ) ;
7933 extern IRType typeOfIRExpr(IRTypeEnv * , IRExpr * ) ;   8009 extern IRType typeOfIRExpr(IRTypeEnv * , IRExpr * ) ;
7934 extern void sanityCheckIRSB(IRSB *bb , HChar *caller , Bool require_flatness ,   8010 extern void sanityCheckIRSB(IRSB *bb , HChar *caller , Bool require_flatness ,
7935                             IRType guest_word_size ) ;   8011                             IRType guest_word_size ) ;
7936 extern Bool isFlatIRStmt(IRStmt * ) ;   8012 extern Bool isFlatIRStmt(IRStmt * ) ;
7937 extern Bool isPlausibleIRType(IRType ty ) ;   8013 extern Bool isPlausibleIRType(IRType ty ) ;
7938 extern HChar const   *LibVEX_ppVexArch(VexArch  ) ;   8014 extern HChar const   *LibVEX_ppVexArch(VexArch  ) ;
7939 extern HChar const   *LibVEX_ppVexHwCaps(VexArch  , UInt  ) ;   8015 extern HChar const   *LibVEX_ppVexHwCaps(VexArch  , UInt  ) ;
7940 extern void LibVEX_default_VexArchInfo(VexArchInfo *vai ) ;   8016 extern void LibVEX_default_VexArchInfo(VexArchInfo *vai ) ;
7941 extern void LibVEX_default_VexAbiInfo(VexAbiInfo *vbi ) ;   8017 extern void LibVEX_default_VexAbiInfo(VexAbiInfo *vbi ) ;
7942 extern void LibVEX_default_VexControl(VexControl *vcon ) ;   8018 extern void LibVEX_default_VexControl(VexControl *vcon ) ;
7943 extern HChar *private_LibVEX_alloc_first ;   8019 extern HChar *private_LibVEX_alloc_first ;
7944 extern HChar *private_LibVEX_alloc_curr ;   8020 extern HChar *private_LibVEX_alloc_curr ;
7945 extern HChar *private_LibVEX_alloc_last ;   8021 extern HChar *private_LibVEX_alloc_last ;
7946 extern  __attribute__((__noreturn__)) void private_LibVEX_alloc_OOM(void) ;   8022 extern  __attribute__((__noreturn__)) void private_LibVEX_alloc_OOM(void) ;
7947 __inline static void *LibVEX_Alloc(Int nbytes )   8023 __inline static void *LibVEX_Alloc(Int nbytes )
7948 {   8024 {
7949   HChar *curr ;   8025   HChar *curr ;
7950   HChar *next ;   8026   HChar *next ;
7951   Int ALIGN ;   8027   Int ALIGN ;
7952     8028  
7953   {   8029   {
7954   ALIGN = (Int )((HWord )(& ((struct align *)0)->x)) - 1;   8030   ALIGN = (Int )((HWord )(& ((struct align *)0)->x)) - 1;
7955   nbytes = (nbytes + ALIGN) & ~ ALIGN;   8031   nbytes = (nbytes + ALIGN) & ~ ALIGN;
7956   curr = private_LibVEX_alloc_curr;   8032   curr = private_LibVEX_alloc_curr;
7957   next = curr + nbytes;   8033   next = curr + nbytes;
7958   if ((unsigned int )next >= (unsigned int )private_LibVEX_alloc_last) {   8034   if ((unsigned int )next >= (unsigned int )private_LibVEX_alloc_last) {
7959     private_LibVEX_alloc_OOM();   8035     private_LibVEX_alloc_OOM();
7960   } else {   8036   } else {
7961     8037  
7962   }   8038   }
7963   private_LibVEX_alloc_curr = next;   8039   private_LibVEX_alloc_curr = next;
7964   return ((void *)curr);   8040   return ((void *)curr);
7965 }   8041 }
7966 }   8042 }
7967 extern void LibVEX_ShowAllocStats(void) ;   8043 extern void LibVEX_ShowAllocStats(void) ;
7968 extern void LibVEX_Init( __attribute__((__noreturn__)) void (*failure_exit)(void) ,   8044 extern void LibVEX_Init( __attribute__((__noreturn__)) void (*failure_exit)(void) ,
7969                         void (*log_bytes)(HChar * , Int nbytes ) ,   8045                         void (*log_bytes)(HChar * , Int nbytes ) ,
7970                         Int debuglevel , Bool valgrind_support ,   8046                         Int debuglevel , Bool valgrind_support ,
7971                         VexControl *vcon ) ;   8047                         VexControl *vcon ) ;
7972 extern VexTranslateResult LibVEX_Translate(VexTranslateArgs * ) ;   8048 extern VexTranslateResult LibVEX_Translate(VexTranslateArgs * ) ;
7973 extern void LibVEX_ShowStats(void) ;   8049 extern void LibVEX_ShowStats(void) ;
7974 extern void (*vgPlain_tl_pre_clo_init)(void) ;   8050 extern void (*vgPlain_tl_pre_clo_init)(void) ;
7975 extern void vgPlain_basic_tool_funcs(void (*post_clo_init)(void) ,   8051 extern void vgPlain_basic_tool_funcs(void (*post_clo_init)(void) ,
7976                                      IRSB *(*instrument)(VgCallbackClosure *closure ,   8052                                      IRSB *(*instrument)(VgCallbackClosure *closure ,
7977                                                          IRSB *sb_in ,   8053                                                          IRSB *sb_in ,
7978                                                          VexGuestLayout *layout ,   8054                                                          VexGuestLayout *layout ,
7979                                                          VexGuestExtents *vge ,   8055                                                          VexGuestExtents *vge ,
7980                                                          IRType gWordTy ,   8056                                                          IRType gWordTy ,
7981                                                          IRType hWordTy ) ,   8057                                                          IRType hWordTy ) ,
7982                                      void (*fini)(Int  ) ) ;   8058                                      void (*fini)(Int  ) ) ;
7983 extern void vgPlain_details_name(Char *name ) ;   8059 extern void vgPlain_details_name(Char *name ) ;
7984 extern void vgPlain_details_version(Char *version ) ;   8060 extern void vgPlain_details_version(Char *version ) ;
7985 extern void vgPlain_details_description(Char *description ) ;   8061 extern void vgPlain_details_description(Char *description ) ;
7986 extern void vgPlain_details_copyright_author(Char *copyright_author ) ;   8062 extern void vgPlain_details_copyright_author(Char *copyright_author ) ;
7987 extern void vgPlain_details_avg_translation_sizeB(UInt size ) ;   8063 extern void vgPlain_details_avg_translation_sizeB(UInt size ) ;
7988 extern void vgPlain_details_bug_reports_to(Char *bug_reports_to ) ;   8064 extern void vgPlain_details_bug_reports_to(Char *bug_reports_to ) ;
7989 extern void vgPlain_needs_libc_freeres(void) ;   8065 extern void vgPlain_needs_libc_freeres(void) ;
7990 extern void vgPlain_needs_core_errors(void) ;   8066 extern void vgPlain_needs_core_errors(void) ;
7991 extern void vgPlain_needs_tool_errors(Bool (*eq_Error)(VgRes res , Error *e1 ,   8067 extern void vgPlain_needs_tool_errors(Bool (*eq_Error)(VgRes res , Error *e1 ,
7992                                                        Error *e2 ) ,   8068                                                        Error *e2 ) ,
7993                                       void (*before_pp_Error)(Error *err ) ,   8069                                       void (*before_pp_Error)(Error *err ) ,
7994                                       void (*pp_Error)(Error *err ) ,   8070                                       void (*pp_Error)(Error *err ) ,
7995                                       Bool show_ThreadIDs_for_errors ,   8071                                       Bool show_ThreadIDs_for_errors ,
7996                                       UInt (*update_extra)(Error *err ) ,   8072                                       UInt (*update_extra)(Error *err ) ,
7997                                       Bool (*recognised_suppression)(Char *name ,   8073                                       Bool (*recognised_suppression)(Char *name ,
7998                                                                      Supp *su ) ,   8074                                                                      Supp *su ) ,
7999                                       Bool (*read_extra_suppression_info)(Int fd ,   8075                                       Bool (*read_extra_suppression_info)(Int fd ,
8000                                                                           Char **bufpp ,   8076                                                                           Char **bufpp ,
8001                                                                           SizeT *nBufp ,   8077                                                                           SizeT *nBufp ,
8002                                                                           Supp *su ) ,   8078                                                                           Supp *su ) ,
8003                                       Bool (*error_matches_suppression)(Error *err ,   8079                                       Bool (*error_matches_suppression)(Error *err ,
8004                                                                         Supp *su ) ,   8080                                                                         Supp *su ) ,
8005                                       Char *(*get_error_name)(Error *err ) ,   8081                                       Char *(*get_error_name)(Error *err ) ,
8006                                       Bool (*print_extra_suppression_info)(Error *err ,   8082                                       Bool (*print_extra_suppression_info)(Error *err ,
8007                                                                            Char *buf ,   8083                                                                            Char *buf ,
8008                                                                            Int nBuf ) ) ;   8084                                                                            Int nBuf ) ) ;
8009 extern void vgPlain_needs_superblock_discards(void (*discard_superblock_info)(Addr64 orig_addr ,   8085 extern void vgPlain_needs_superblock_discards(void (*discard_superblock_info)(Addr64 orig_addr ,
8010                                                                               VexGuestExtents extents ) ) ;   8086                                                                               VexGuestExtents extents ) ) ;
8011 extern void vgPlain_needs_command_line_options(Bool (*process_cmd_line_option)(Char *argv ) ,   8087 extern void vgPlain_needs_command_line_options(Bool (*process_cmd_line_option)(Char *argv ) ,
8012                                                void (*print_usage)(void) ,   8088                                                void (*print_usage)(void) ,
8013                                                void (*print_debug_usage)(void) ) ;   8089                                                void (*print_debug_usage)(void) ) ;
8014 extern void vgPlain_needs_client_requests(Bool (*handle_client_request)(ThreadId tid ,   8090 extern void vgPlain_needs_client_requests(Bool (*handle_client_request)(ThreadId tid ,
8015                                                                         UWord *arg_block ,   8091                                                                         UWord *arg_block ,
8016                                                                         UWord *ret ) ) ;   8092                                                                         UWord *ret ) ) ;
8017 extern void vgPlain_needs_syscall_wrapper(void (*pre_syscall)(ThreadId tid ,   8093 extern void vgPlain_needs_syscall_wrapper(void (*pre_syscall)(ThreadId tid ,
8018                                                               UInt syscallno ,   8094                                                               UInt syscallno ,
8019                                                               UWord *args ,   8095                                                               UWord *args ,
8020                                                               UInt nArgs ) ,   8096                                                               UInt nArgs ) ,
8021                                           void (*post_syscall)(ThreadId tid ,   8097                                           void (*post_syscall)(ThreadId tid ,
8022                                                                UInt syscallno ,   8098                                                                UInt syscallno ,
8023                                                                UWord *args ,   8099                                                                UWord *args ,
8024                                                                UInt nArgs ,   8100                                                                UInt nArgs ,
8025                                                                SysRes res ) ) ;   8101                                                                SysRes res ) ) ;
8026 extern void vgPlain_needs_sanity_checks(Bool (*cheap_sanity_check)(void) ,   8102 extern void vgPlain_needs_sanity_checks(Bool (*cheap_sanity_check)(void) ,
8027                                         Bool (*expensive_sanity_check)(void) ) ;   8103                                         Bool (*expensive_sanity_check)(void) ) ;
8028 extern void vgPlain_needs_var_info(void) ;   8104 extern void vgPlain_needs_var_info(void) ;
8029 extern void vgPlain_needs_malloc_replacement(void *(*pmalloc)(ThreadId tid ,   8105 extern void vgPlain_needs_malloc_replacement(void *(*pmalloc)(ThreadId tid ,
8030                                                               SizeT n ) ,   8106                                                               SizeT n ) ,
8031                                              void *(*p__builtin_new)(ThreadId tid ,   8107                                              void *(*p__builtin_new)(ThreadId tid ,
8032                                                                      SizeT n ) ,   8108                                                                      SizeT n ) ,
8033                                              void *(*p__builtin_vec_new)(ThreadId tid ,   8109                                              void *(*p__builtin_vec_new)(ThreadId tid ,
8034                                                                          SizeT n ) ,   8110                                                                          SizeT n ) ,
8035                                              void *(*pmemalign)(ThreadId tid ,   8111                                              void *(*pmemalign)(ThreadId tid ,
8036                                                                 SizeT align ,   8112                                                                 SizeT align ,
8037                                                                 SizeT n ) ,   8113                                                                 SizeT n ) ,
8038                                              void *(*pcalloc)(ThreadId tid ,   8114                                              void *(*pcalloc)(ThreadId tid ,
8039                                                               SizeT nmemb ,   8115                                                               SizeT nmemb ,
8040                                                               SizeT size1 ) ,   8116                                                               SizeT size1 ) ,
8041                                              void (*pfree)(ThreadId tid ,   8117                                              void (*pfree)(ThreadId tid ,
8042                                                            void *p ) ,   8118                                                            void *p ) ,
8043                                              void (*p__builtin_delete)(ThreadId tid ,   8119                                              void (*p__builtin_delete)(ThreadId tid ,
8044                                                                        void *p ) ,   8120                                                                        void *p ) ,
8045                                              void (*p__builtin_vec_delete)(ThreadId tid ,   8121                                              void (*p__builtin_vec_delete)(ThreadId tid ,
8046                                                                            void *p ) ,   8122                                                                            void *p ) ,
8047                                              void *(*prealloc)(ThreadId tid ,   8123                                              void *(*prealloc)(ThreadId tid ,
8048                                                                void *p ,   8124                                                                void *p ,
8049                                                                SizeT new_size ) ,   8125                                                                SizeT new_size ) ,
8050                                              SizeT (*pmalloc_usable_size)(ThreadId tid ,   8126                                              SizeT (*pmalloc_usable_size)(ThreadId tid ,
8051                                                                           void *p ) ,   8127                                                                           void *p ) ,
8052                                              SizeT client_malloc_redzone_szB ) ;   8128                                              SizeT client_malloc_redzone_szB ) ;
8053 extern void vgPlain_needs_xml_output(void) ;   8129 extern void vgPlain_needs_xml_output(void) ;
8054 extern void vgPlain_needs_final_IR_tidy_pass(IRSB *(*final_tidy)(IRSB * ) ) ;   8130 extern void vgPlain_needs_final_IR_tidy_pass(IRSB *(*final_tidy)(IRSB * ) ) ;
8055 extern void vgPlain_track_new_mem_startup(void (*f)(Addr a , SizeT len ,   8131 extern void vgPlain_track_new_mem_startup(void (*f)(Addr a , SizeT len ,
8056                                                     Bool rr , Bool ww ,   8132                                                     Bool rr , Bool ww ,
8057                                                     Bool xx , ULong di_handle ) ) ;   8133                                                     Bool xx , ULong di_handle ) ) ;
8058 extern void vgPlain_track_new_mem_stack_signal(void (*f)(Addr a , SizeT len ,   8134 extern void vgPlain_track_new_mem_stack_signal(void (*f)(Addr a , SizeT len ,
8059                                                          ThreadId tid ) ) ;   8135                                                          ThreadId tid ) ) ;
8060 extern void vgPlain_track_new_mem_brk(void (*f)(Addr a , SizeT len ,   8136 extern void vgPlain_track_new_mem_brk(void (*f)(Addr a , SizeT len ,
8061                                                 ThreadId tid ) ) ;   8137                                                 ThreadId tid ) ) ;
8062 extern void vgPlain_track_new_mem_mmap(void (*f)(Addr a , SizeT len , Bool rr ,   8138 extern void vgPlain_track_new_mem_mmap(void (*f)(Addr a , SizeT len , Bool rr ,
8063                                                  Bool ww , Bool xx ,   8139                                                  Bool ww , Bool xx ,
8064                                                  ULong di_handle ) ) ;   8140                                                  ULong di_handle ) ) ;
8065 extern void vgPlain_track_copy_mem_remap(void (*f)(Addr from , Addr to ,   8141 extern void vgPlain_track_copy_mem_remap(void (*f)(Addr from , Addr to ,
8066                                                    SizeT len ) ) ;   8142                                                    SizeT len ) ) ;
8067 extern void vgPlain_track_change_mem_mprotect(void (*f)(Addr a , SizeT len ,   8143 extern void vgPlain_track_change_mem_mprotect(void (*f)(Addr a , SizeT len ,
8068                                                         Bool rr , Bool ww ,   8144                                                         Bool rr , Bool ww ,
8069                                                         Bool xx ) ) ;   8145                                                         Bool xx ) ) ;
8070 extern void vgPlain_track_die_mem_stack_signal(void (*f)(Addr a , SizeT len ) ) ;   8146 extern void vgPlain_track_die_mem_stack_signal(void (*f)(Addr a , SizeT len ) ) ;
8071 extern void vgPlain_track_die_mem_brk(void (*f)(Addr a , SizeT len ) ) ;   8147 extern void vgPlain_track_die_mem_brk(void (*f)(Addr a , SizeT len ) ) ;
8072 extern void vgPlain_track_die_mem_munmap(void (*f)(Addr a , SizeT len ) ) ;   8148 extern void vgPlain_track_die_mem_munmap(void (*f)(Addr a , SizeT len ) ) ;
8073 extern void vgPlain_track_new_mem_stack_4_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,   8149 extern void vgPlain_track_new_mem_stack_4_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,
8074                                                                                              UInt ecu ) ) ;   8150                                                                                              UInt ecu ) ) ;
8075 extern void vgPlain_track_new_mem_stack_8_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,   8151 extern void vgPlain_track_new_mem_stack_8_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,
8076                                                                                              UInt ecu ) ) ;   8152                                                                                              UInt ecu ) ) ;
8077 extern void vgPlain_track_new_mem_stack_12_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,   8153 extern void vgPlain_track_new_mem_stack_12_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,
8078                                                                                               UInt ecu ) ) ;   8154                                                                                               UInt ecu ) ) ;
8079 extern void vgPlain_track_new_mem_stack_16_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,   8155 extern void vgPlain_track_new_mem_stack_16_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,
8080                                                                                               UInt ecu ) ) ;   8156                                                                                               UInt ecu ) ) ;
8081 extern void vgPlain_track_new_mem_stack_32_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,   8157 extern void vgPlain_track_new_mem_stack_32_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,
8082                                                                                               UInt ecu ) ) ;   8158                                                                                               UInt ecu ) ) ;
8083 extern void vgPlain_track_new_mem_stack_112_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,   8159 extern void vgPlain_track_new_mem_stack_112_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,
8084                                                                                                UInt ecu ) ) ;   8160                                                                                                UInt ecu ) ) ;
8085 extern void vgPlain_track_new_mem_stack_128_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,   8161 extern void vgPlain_track_new_mem_stack_128_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,
8086                                                                                                UInt ecu ) ) ;   8162                                                                                                UInt ecu ) ) ;
8087 extern void vgPlain_track_new_mem_stack_144_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,   8163 extern void vgPlain_track_new_mem_stack_144_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,
8088                                                                                                UInt ecu ) ) ;   8164                                                                                                UInt ecu ) ) ;
8089 extern void vgPlain_track_new_mem_stack_160_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,   8165 extern void vgPlain_track_new_mem_stack_160_w_ECU(void ( __attribute__((__regparm__(2))) (*f))(Addr new_ESP ,
8090                                                                                                UInt ecu ) ) ;   8166                                                                                                UInt ecu ) ) ;
8091 extern void vgPlain_track_new_mem_stack_w_ECU(void (*f)(Addr a , SizeT len ,   8167 extern void vgPlain_track_new_mem_stack_w_ECU(void (*f)(Addr a , SizeT len ,
8092                                                         UInt ecu ) ) ;   8168                                                         UInt ecu ) ) ;
8093 extern void vgPlain_track_new_mem_stack_4(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;   8169 extern void vgPlain_track_new_mem_stack_4(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;
8094 extern void vgPlain_track_new_mem_stack_8(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;   8170 extern void vgPlain_track_new_mem_stack_8(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;
8095 extern void vgPlain_track_new_mem_stack_12(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;   8171 extern void vgPlain_track_new_mem_stack_12(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;
8096 extern void vgPlain_track_new_mem_stack_16(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;   8172 extern void vgPlain_track_new_mem_stack_16(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;
8097 extern void vgPlain_track_new_mem_stack_32(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;   8173 extern void vgPlain_track_new_mem_stack_32(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;
8098 extern void vgPlain_track_new_mem_stack_112(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;   8174 extern void vgPlain_track_new_mem_stack_112(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;
8099 extern void vgPlain_track_new_mem_stack_128(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;   8175 extern void vgPlain_track_new_mem_stack_128(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;
8100 extern void vgPlain_track_new_mem_stack_144(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;   8176 extern void vgPlain_track_new_mem_stack_144(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;
8101 extern void vgPlain_track_new_mem_stack_160(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;   8177 extern void vgPlain_track_new_mem_stack_160(void ( __attribute__((__regparm__(1))) (*f))(Addr new_ESP ) ) ;
8102 extern void vgPlain_track_new_mem_stack(void (*f)(Addr a , SizeT len ) ) ;   8178 extern void vgPlain_track_new_mem_stack(void (*f)(Addr a , SizeT len ) ) ;
8103 extern void vgPlain_track_die_mem_stack_4(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;   8179 extern void vgPlain_track_die_mem_stack_4(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;
8104 extern void vgPlain_track_die_mem_stack_8(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;   8180 extern void vgPlain_track_die_mem_stack_8(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;
8105 extern void vgPlain_track_die_mem_stack_12(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;   8181 extern void vgPlain_track_die_mem_stack_12(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;
8106 extern void vgPlain_track_die_mem_stack_16(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;   8182 extern void vgPlain_track_die_mem_stack_16(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;
8107 extern void vgPlain_track_die_mem_stack_32(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;   8183 extern void vgPlain_track_die_mem_stack_32(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;
8108 extern void vgPlain_track_die_mem_stack_112(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;   8184 extern void vgPlain_track_die_mem_stack_112(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;
8109 extern void vgPlain_track_die_mem_stack_128(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;   8185 extern void vgPlain_track_die_mem_stack_128(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;
8110 extern void vgPlain_track_die_mem_stack_144(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;   8186 extern void vgPlain_track_die_mem_stack_144(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;
8111 extern void vgPlain_track_die_mem_stack_160(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;   8187 extern void vgPlain_track_die_mem_stack_160(void ( __attribute__((__regparm__(1))) (*f))(Addr die_ESP ) ) ;
8112 extern void vgPlain_track_die_mem_stack(void (*f)(Addr a , SizeT len ) ) ;   8188 extern void vgPlain_track_die_mem_stack(void (*f)(Addr a , SizeT len ) ) ;
8113 extern void vgPlain_track_ban_mem_stack(void (*f)(Addr a , SizeT len ) ) ;   8189 extern void vgPlain_track_ban_mem_stack(void (*f)(Addr a , SizeT len ) ) ;
8114 extern void vgPlain_track_pre_mem_read(void (*f)(CorePart part , ThreadId tid ,   8190 extern void vgPlain_track_pre_mem_read(void (*f)(CorePart part , ThreadId tid ,
8115                                                  Char *s , Addr a , SizeT size ) ) ;   8191                                                  Char *s , Addr a , SizeT size ) ) ;
8116 extern void vgPlain_track_pre_mem_read_asciiz(void (*f)(CorePart part ,   8192 extern void vgPlain_track_pre_mem_read_asciiz(void (*f)(CorePart part ,
8117                                                         ThreadId tid , Char *s ,   8193                                                         ThreadId tid , Char *s ,
8118                                                         Addr a ) ) ;   8194                                                         Addr a ) ) ;
8119 extern void vgPlain_track_pre_mem_write(void (*f)(CorePart part , ThreadId tid ,   8195 extern void vgPlain_track_pre_mem_write(void (*f)(CorePart part , ThreadId tid ,
8120                                                   Char *s , Addr a , SizeT size ) ) ;   8196                                                   Char *s , Addr a , SizeT size ) ) ;
8121 extern void vgPlain_track_post_mem_write(void (*f)(CorePart part ,   8197 extern void vgPlain_track_post_mem_write(void (*f)(CorePart part ,
8122                                                    ThreadId tid , Addr a ,   8198                                                    ThreadId tid , Addr a ,
8123                                                    SizeT size ) ) ;   8199                                                    SizeT size ) ) ;
8124 extern void vgPlain_track_pre_reg_read(void (*f)(CorePart part , ThreadId tid ,   8200 extern void vgPlain_track_pre_reg_read(void (*f)(CorePart part , ThreadId tid ,
8125                                                  Char *s ,   8201                                                  Char *s ,
8126                                                  PtrdiffT guest_state_offset ,   8202                                                  PtrdiffT guest_state_offset ,
8127                                                  SizeT size ) ) ;   8203                                                  SizeT size ) ) ;
8128 extern void vgPlain_track_post_reg_write(void (*f)(CorePart part ,   8204 extern void vgPlain_track_post_reg_write(void (*f)(CorePart part ,
8129                                                    ThreadId tid ,   8205                                                    ThreadId tid ,
8130                                                    PtrdiffT guest_state_offset ,   8206                                                    PtrdiffT guest_state_offset ,
8131                                                    SizeT size ) ) ;   8207                                                    SizeT size ) ) ;
8132 extern void vgPlain_track_post_reg_write_clientcall_return(void (*f)(ThreadId tid ,   8208 extern void vgPlain_track_post_reg_write_clientcall_return(void (*f)(ThreadId tid ,
8133                                                                      PtrdiffT guest_state_offset ,   8209                                                                      PtrdiffT guest_state_offset ,
8134                                                                      SizeT size ,   8210                                                                      SizeT size ,
8135                                                                      Addr f ) ) ;   8211                                                                      Addr f ) ) ;
8136 extern void vgPlain_track_start_client_code(void (*f)(ThreadId tid ,   8212 extern void vgPlain_track_start_client_code(void (*f)(ThreadId tid ,
8137                                                       ULong blocks_dispatched ) ) ;   8213                                                       ULong blocks_dispatched ) ) ;
8138 extern void vgPlain_track_stop_client_code(void (*f)(ThreadId tid ,   8214 extern void vgPlain_track_stop_client_code(void (*f)(ThreadId tid ,
8139                                                      ULong blocks_dispatched ) ) ;   8215                                                      ULong blocks_dispatched ) ) ;
8140 extern void vgPlain_track_pre_thread_ll_create(void (*f)(ThreadId tid ,   8216 extern void vgPlain_track_pre_thread_ll_create(void (*f)(ThreadId tid ,
8141                                                          ThreadId child ) ) ;   8217                                                          ThreadId child ) ) ;
8142 extern void vgPlain_track_pre_thread_first_insn(void (*f)(ThreadId tid ) ) ;   8218 extern void vgPlain_track_pre_thread_first_insn(void (*f)(ThreadId tid ) ) ;
8143 extern void vgPlain_track_pre_thread_ll_exit(void (*f)(ThreadId tid ) ) ;   8219 extern void vgPlain_track_pre_thread_ll_exit(void (*f)(ThreadId tid ) ) ;
8144 extern void vgPlain_track_pre_deliver_signal(void (*f)(ThreadId tid ,   8220 extern void vgPlain_track_pre_deliver_signal(void (*f)(ThreadId tid ,
8145                                                        Int sigNo ,   8221                                                        Int sigNo ,
8146                                                        Bool alt_stack ) ) ;   8222                                                        Bool alt_stack ) ) ;
8147 extern void vgPlain_track_post_deliver_signal(void (*f)(ThreadId tid ,   8223 extern void vgPlain_track_post_deliver_signal(void (*f)(ThreadId tid ,
8148                                                         Int sigNo ) ) ;   8224                                                         Int sigNo ) ) ;
8149 Bool vgDrd_get_check_stack_accesses(void) ;   8225 Bool vgDrd_get_check_stack_accesses(void) ;
8150 void vgDrd_set_check_stack_accesses(Bool const   c ) ;   8226 void vgDrd_set_check_stack_accesses(Bool const   c ) ;
8151 Bool vgDrd_get_first_race_only(void) ;   8227 Bool vgDrd_get_first_race_only(void) ;
8152 void vgDrd_set_first_race_only(Bool const   fro ) ;   8228 void vgDrd_set_first_race_only(Bool const   fro ) ;
8153 IRSB *vgDrd_instrument(VgCallbackClosure * const  closure ,   8229 IRSB *vgDrd_instrument(VgCallbackClosure * const  closure ,
8154                        IRSB * const  bb_in , VexGuestLayout * const  layout ,   8230                        IRSB * const  bb_in , VexGuestLayout * const  layout ,
8155                        VexGuestExtents * const  vge , IRType const   gWordTy ,   8231                        VexGuestExtents * const  vge , IRType const   gWordTy ,
8156                        IRType const   hWordTy ) ;   8232                        IRType const   hWordTy ) ;
8157 void vgDrd_trace_mem_access(Addr const   addr , SizeT const   size ,   8233 void vgDrd_trace_mem_access(Addr const   addr , SizeT const   size ,
8158                             BmAccessTypeT const   access_type ,   8234                             BmAccessTypeT const   access_type ,
8159                             HWord const   stored_value_hi ,   8235                             HWord const   stored_value_hi ,
8160                             HWord const   stored_value_lo ) ;   8236                             HWord const   stored_value_lo ) ;
8161 void ( __attribute__((__regparm__(2))) vgDrd_trace_load)(Addr addr , SizeT size ) ;   8237 void ( __attribute__((__regparm__(2))) vgDrd_trace_load)(Addr addr , SizeT size ) ;
8162 void ( __attribute__((__regparm__(2))) vgDrd_trace_store)(Addr addr ,   8238 void ( __attribute__((__regparm__(2))) vgDrd_trace_store)(Addr addr ,
8163                                                           SizeT size ) ;   8239                                                           SizeT size ) ;
8164 extern void vgDrd_clean_memory(Addr const   a1 , SizeT const   len ) ;   8240 extern void vgDrd_clean_memory(Addr const   a1 , SizeT const   len ) ;
8165 static ULong s_segment_merge_count  ;   8241 static ULong s_segment_merge_count  ;
8166 static ULong s_segments_created_count  ;   8242 static ULong s_segments_created_count  ;
8167 static ULong s_segments_alive_count  ;   8243 static ULong s_segments_alive_count  ;
8168 static ULong s_max_segments_alive_count  ;   8244 static ULong s_max_segments_alive_count  ;
8169 static Bool s_trace_segment  ;   8245 static Bool s_trace_segment  ;
8170 static void sg_init(Segment * const  sg , DrdThreadId const   creator ,   8246 static void sg_init(Segment * const  sg , DrdThreadId const   creator ,
8171                     DrdThreadId const   created )   8247                     DrdThreadId const   created )
8172 {   8248 {
8173   Segment *creator_sg ;   8249   Segment *creator_sg ;
8174   ThreadId vg_created ;   8250   ThreadId vg_created ;
8175   ThreadId tmp ;   8251   ThreadId tmp ;
8176   long tmp___0 ;   8252   long tmp___0 ;
8177   Bool tmp___1 ;   8253   Bool tmp___1 ;
8178   int tmp___2 ;   8254   int tmp___2 ;
8179   long tmp___3 ;   8255   long tmp___3 ;
8180   Segment *tmp___4 ;   8256   Segment *tmp___4 ;
8181   Addr tmp___5 ;   8257   Addr tmp___5 ;
8182   char *vc ;   8258   char *vc ;
8183     8259  
8184   {   8260   {
8185   tmp = vgDrd_DrdThreadIdToVgThreadId(created);   8261   tmp = vgDrd_DrdThreadIdToVgThreadId(created);
8186   vg_created = tmp;   8262   vg_created = tmp;
8187   tmp___0 = __builtin_expect((long )(! (! sg)), 1L);   8263   tmp___0 = __builtin_expect((long )(! (! sg)), 1L);
8188   if (tmp___0) {   8264   if (tmp___0) {
8189     8265  
8190   } else {   8266   } else {
8191     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",   8267     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",
8192                         (Char const   *)"drd_segment.c", 69,   8268                         (Char const   *)"drd_segment.c", 69,
8193                         (Char const   *)"sg_init", "");   8269                         (Char const   *)"sg_init", "");
8194   }   8270   }
8195   if (creator == 0U) {   8271   if (creator == 0U) {
8196     tmp___2 = 1;   8272     tmp___2 = 1;
8197   } else {   8273   } else {
8198     tmp___1 = vgDrd_IsValidDrdThreadId(creator);   8274     tmp___1 = vgDrd_IsValidDrdThreadId(creator);
8199     if (tmp___1) {   8275     if (tmp___1) {
8200       tmp___2 = 1;   8276       tmp___2 = 1;
8201     } else {   8277     } else {
8202       tmp___2 = 0;   8278       tmp___2 = 0;
8203     }   8279     }
8204   }   8280   }
8205   tmp___3 = __builtin_expect((long )tmp___2, 1L);   8281   tmp___3 = __builtin_expect((long )tmp___2, 1L);
8206   if (tmp___3) {   8282   if (tmp___3) {
8207     8283  
8208   } else {   8284   } else {
8209     vgPlain_assert_fail((Bool )0,   8285     vgPlain_assert_fail((Bool )0,
8210                         (Char const   *)"creator == DRD_INVALID_THREADID || DRD_(IsValidDrdThreadId)(creator)",   8286                         (Char const   *)"creator == DRD_INVALID_THREADID || DRD_(IsValidDrdThreadId)(creator)",
8211                         (Char const   *)"drd_segment.c", 71,   8287                         (Char const   *)"drd_segment.c", 71,
8212                         (Char const   *)"sg_init", "");   8288                         (Char const   *)"sg_init", "");
8213   }   8289   }
8214   if (creator != 0U) {   8290   if (creator != 0U) {
8215     tmp___4 = vgDrd_thread_get_segment(creator);   8291     tmp___4 = vgDrd_thread_get_segment(creator);
8216     creator_sg = tmp___4;   8292     creator_sg = tmp___4;
8217   } else {   8293   } else {
8218     creator_sg = (Segment *)0;   8294     creator_sg = (Segment *)0;
8219   }   8295   }
8220   sg->g_next = (struct segment *)((void *)0);   8296   sg->g_next = (struct segment *)((void *)0);
8221   sg->g_prev = (struct segment *)((void *)0);   8297   sg->g_prev = (struct segment *)((void *)0);
8222   sg->thr_next = (struct segment *)((void *)0);   8298   sg->thr_next = (struct segment *)((void *)0);
8223   sg->thr_prev = (struct segment *)((void *)0);   8299   sg->thr_prev = (struct segment *)((void *)0);
8224   sg->tid = (DrdThreadId )created;   8300   sg->tid = (DrdThreadId )created;
8225   sg->refcnt = 1;   8301   sg->refcnt = 1;
8226   if (vg_created != 0U) {   8302   if (vg_created != 0U) {
8227     tmp___5 = vgPlain_get_SP(vg_created);   8303     tmp___5 = vgPlain_get_SP(vg_created);
8228     if (tmp___5 != 0UL) {   8304     if (tmp___5 != 0UL) {
8229       sg->stacktrace = vgPlain_record_ExeContext(vg_created, (Word )0);   8305       sg->stacktrace = vgPlain_record_ExeContext(vg_created, (Word )0);
8230     } else {   8306     } else {
8231       sg->stacktrace = (ExeContext *)0;   8307       sg->stacktrace = (ExeContext *)0;
8232     }   8308     }
8233   } else {   8309   } else {
8234     sg->stacktrace = (ExeContext *)0;   8310     sg->stacktrace = (ExeContext *)0;
8235   }   8311   }
8236   if (creator_sg) {   8312   if (creator_sg) {
8237     vgDrd_vc_copy((VectorClock */* const  */)(& sg->vc),   8313     vgDrd_vc_copy((VectorClock */* const  */)(& sg->vc),
8238                   (VectorClock const   */* const  */)(& creator_sg->vc));   8314                   (VectorClock const   */* const  */)(& creator_sg->vc));
8239   } else {   8315   } else {
8240     vgDrd_vc_init((VectorClock */* const  */)(& sg->vc),   8316     vgDrd_vc_init((VectorClock */* const  */)(& sg->vc),
8241                   (VCElem const   */* const  */)0, (unsigned int const   )0);   8317                   (VCElem const   */* const  */)0, (unsigned int const   )0);
8242   }   8318   }
8243   vgDrd_vc_increment((VectorClock */* const  */)(& sg->vc), created);   8319   vgDrd_vc_increment((VectorClock */* const  */)(& sg->vc), created);
8244   vgDrd_bm_init((struct bitmap */* const  */)(& sg->bm));   8320   vgDrd_bm_init((struct bitmap */* const  */)(& sg->bm));
8245   if (s_trace_segment) {   8321   if (s_trace_segment) {
8246     vc = vgDrd_vc_aprint((VectorClock const   */* const  */)(& sg->vc));   8322     vc = vgDrd_vc_aprint((VectorClock const   */* const  */)(& sg->vc));
8247     vgPlain_message((VgMsgKind )2, "New segment for thread %d with vc %s\n",   8323     vgPlain_message((VgMsgKind )2, "New segment for thread %d with vc %s\n",
8248                     created, vc);   8324                     created, vc);
8249     vgPlain_free((void *)vc);   8325     vgPlain_free((void *)vc);
8250   } else {   8326   } else {
8251     8327  
8252   }   8328   }
8253   return;   8329   return;
8254 }   8330 }
8255 }   8331 }
8256 static void vgDrd_sg_cleanup(Segment * const  sg )   8332 static void vgDrd_sg_cleanup(Segment * const  sg )
8257 {   8333 {
8258   long tmp ;   8334   long tmp ;
8259   long tmp___0 ;   8335   long tmp___0 ;
8260     8336  
8261   {   8337   {
8262   tmp = __builtin_expect((long )(! (! sg)), 1L);   8338   tmp = __builtin_expect((long )(! (! sg)), 1L);
8263   if (tmp) {   8339   if (tmp) {
8264     8340  
8265   } else {   8341   } else {
8266     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",   8342     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",
8267                         (Char const   *)"drd_segment.c", 109,   8343                         (Char const   *)"drd_segment.c", 109,
8268                         (Char const   *)"vgDrd_sg_cleanup", "");   8344                         (Char const   *)"vgDrd_sg_cleanup", "");
8269   }   8345   }
8270   tmp___0 = __builtin_expect((long )(! (! (sg->refcnt == 0))), 1L);   8346   tmp___0 = __builtin_expect((long )(! (! (sg->refcnt == 0))), 1L);
8271   if (tmp___0) {   8347   if (tmp___0) {
8272     8348  
8273   } else {   8349   } else {
8274     vgPlain_assert_fail((Bool )0, (Char const   *)"sg->refcnt == 0",   8350     vgPlain_assert_fail((Bool )0, (Char const   *)"sg->refcnt == 0",
8275                         (Char const   *)"drd_segment.c", 110,   8351                         (Char const   *)"drd_segment.c", 110,
8276                         (Char const   *)"vgDrd_sg_cleanup", "");   8352                         (Char const   *)"vgDrd_sg_cleanup", "");
8277   }   8353   }
8278   vgDrd_vc_cleanup((VectorClock */* const  */)(& sg->vc));   8354   vgDrd_vc_cleanup((VectorClock */* const  */)(& sg->vc));
8279   vgDrd_bm_cleanup((struct bitmap */* const  */)(& sg->bm));   8355   vgDrd_bm_cleanup((struct bitmap */* const  */)(& sg->bm));
8280   return;   8356   return;
8281 }   8357 }
8282 }   8358 }
8283 Segment *vgDrd_sg_new(DrdThreadId const   creator , DrdThreadId const   created )   8359 Segment *vgDrd_sg_new(DrdThreadId const   creator , DrdThreadId const   created )
8284 {   8360 {
8285   Segment *sg ;   8361   Segment *sg ;
8286   void *tmp ;   8362   void *tmp ;
8287   long tmp___0 ;   8363   long tmp___0 ;
8288     8364  
8289   {   8365   {
8290   s_segments_created_count ++;   8366   s_segments_created_count ++;
8291   s_segments_alive_count ++;   8367   s_segments_alive_count ++;
8292   if (s_max_segments_alive_count < s_segments_alive_count) {   8368   if (s_max_segments_alive_count < s_segments_alive_count) {
8293     s_max_segments_alive_count = s_segments_alive_count;   8369     s_max_segments_alive_count = s_segments_alive_count;
8294   } else {   8370   } else {
8295     8371  
8296   }   8372   }
8297   tmp = vgPlain_malloc((HChar *)"drd.segment.sn.1", (SizeT )sizeof(*sg));   8373   tmp = vgPlain_malloc((HChar *)"drd.segment.sn.1", (SizeT )sizeof(*sg));
8298   sg = (Segment *)tmp;   8374   sg = (Segment *)tmp;
8299   tmp___0 = __builtin_expect((long )(! (! sg)), 1L);   8375   tmp___0 = __builtin_expect((long )(! (! sg)), 1L);
8300   if (tmp___0) {   8376   if (tmp___0) {
8301     8377  
8302   } else {   8378   } else {
8303     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",   8379     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",
8304                         (Char const   *)"drd_segment.c", 127,   8380                         (Char const   *)"drd_segment.c", 127,
8305                         (Char const   *)"vgDrd_sg_new", "");   8381                         (Char const   *)"vgDrd_sg_new", "");
8306   }   8382   }
8307   sg_init((Segment */* const  */)sg, creator, created);   8383   sg_init((Segment */* const  */)sg, creator, created);
8308   if (vgDrd_g_sg_list) {   8384   if (vgDrd_g_sg_list) {
8309     vgDrd_g_sg_list->g_prev = sg;   8385     vgDrd_g_sg_list->g_prev = sg;
8310     sg->g_next = vgDrd_g_sg_list;   8386     sg->g_next = vgDrd_g_sg_list;
8311   } else {   8387   } else {
8312     8388  
8313   }   8389   }
8314   vgDrd_g_sg_list = sg;   8390   vgDrd_g_sg_list = sg;
8315   return (sg);   8391   return (sg);
8316 }   8392 }
8317 }   8393 }
8318 static void vgDrd_sg_delete(Segment * const  sg )   8394 static void vgDrd_sg_delete(Segment * const  sg )
8319 {   8395 {
8320   char *vc ;   8396   char *vc ;
8321   Bool tmp ;   8397   Bool tmp ;
8322   long tmp___0 ;   8398   long tmp___0 ;
8323     8399  
8324   {   8400   {
8325   tmp = vgDrd_sg_get_trace();   8401   tmp = vgDrd_sg_get_trace();
8326   if (tmp) {   8402   if (tmp) {
8327     vc = vgDrd_vc_aprint((VectorClock const   */* const  */)(& sg->vc));   8403     vc = vgDrd_vc_aprint((VectorClock const   */* const  */)(& sg->vc));
8328     vgPlain_message((VgMsgKind )2,   8404     vgPlain_message((VgMsgKind )2,
8329                     "Discarding the segment with vector clock %s\n", vc);   8405                     "Discarding the segment with vector clock %s\n", vc);
8330     vgPlain_free((void *)vc);   8406     vgPlain_free((void *)vc);
8331   } else {   8407   } else {
8332     8408  
8333   }   8409   }
8334   s_segments_alive_count --;   8410   s_segments_alive_count --;
8335   tmp___0 = __builtin_expect((long )(! (! sg)), 1L);   8411   tmp___0 = __builtin_expect((long )(! (! sg)), 1L);
8336   if (tmp___0) {   8412   if (tmp___0) {
8337     8413  
8338   } else {   8414   } else {
8339     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",   8415     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",
8340                         (Char const   *)"drd_segment.c", 151,   8416                         (Char const   *)"drd_segment.c", 151,
8341                         (Char const   *)"vgDrd_sg_delete", "");   8417                         (Char const   *)"vgDrd_sg_delete", "");
8342   }   8418   }
8343   if (sg->g_next) {   8419   if (sg->g_next) {
8344     (sg->g_next)->g_prev = sg->g_prev;   8420     (sg->g_next)->g_prev = sg->g_prev;
8345   } else {   8421   } else {
8346     8422  
8347   }   8423   }
8348   if (sg->g_prev) {   8424   if (sg->g_prev) {
8349     (sg->g_prev)->g_next = sg->g_next;   8425     (sg->g_prev)->g_next = sg->g_next;
8350   } else {   8426   } else {
8351     vgDrd_g_sg_list = sg->g_next;   8427     vgDrd_g_sg_list = sg->g_next;
8352   }   8428   }
8353   vgDrd_sg_cleanup(sg);   8429   vgDrd_sg_cleanup(sg);
8354   vgPlain_free((void *)sg);   8430   vgPlain_free((void *)sg);
8355   return;   8431   return;
8356 }   8432 }
8357 }   8433 }
8358 Segment *vgDrd_sg_get(Segment * const  sg )   8434 Segment *vgDrd_sg_get(Segment * const  sg )
8359 {   8435 {
8360   long tmp ;   8436   long tmp ;
8361     8437  
8362   {   8438   {
8363   tmp = __builtin_expect((long )(! (! sg)), 1L);   8439   tmp = __builtin_expect((long )(! (! sg)), 1L);
8364   if (tmp) {   8440   if (tmp) {
8365     8441  
8366   } else {   8442   } else {
8367     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",   8443     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",
8368                         (Char const   *)"drd_segment.c", 165,   8444                         (Char const   *)"drd_segment.c", 165,
8369                         (Char const   *)"vgDrd_sg_get", "");   8445                         (Char const   *)"vgDrd_sg_get", "");
8370   }   8446   }
8371   (sg->refcnt) ++;   8447   (sg->refcnt) ++;
8372   return ((Segment *)sg);   8448   return ((Segment *)sg);
8373 }   8449 }
8374 }   8450 }
8375 void vgDrd_sg_put(Segment * const  sg )   8451 void vgDrd_sg_put(Segment * const  sg )
8376 {   8452 {
8377   char *vc ;   8453   char *vc ;
8378   long tmp ;   8454   long tmp ;
8379     8455  
8380   {   8456   {
8381   if ((unsigned int )sg == (unsigned int )((Segment */* const  */)0)) {   8457   if ((unsigned int )sg == (unsigned int )((Segment */* const  */)0)) {
8382     return;   8458     return;
8383   } else {   8459   } else {
8384     8460  
8385   }   8461   }
8386   if (s_trace_segment) {   8462   if (s_trace_segment) {
8387     vc = vgDrd_vc_aprint((VectorClock const   */* const  */)(& sg->vc));   8463     vc = vgDrd_vc_aprint((VectorClock const   */* const  */)(& sg->vc));
    -+ 8464     {
      8465     if (sg->refcnt < 2) {
      8466       return;
      8467     }
8388     vgPlain_message((VgMsgKind )2, = 8468     vgPlain_message((VgMsgKind )2,
8389                     "Decrementing segment reference count %d -> %d with vc %s\n",   8469                     "Decrementing segment reference count %d -> %d with vc %s\n",
8390                     sg->refcnt, sg->refcnt - 1, vc);   8470                     sg->refcnt, sg->refcnt - 1, vc);
    -+ 8471     }
8391     vgPlain_free((void *)vc); = 8472     vgPlain_free((void *)vc);
8392   } else {   8473   } else {
8393     8474  
8394   }   8475   }
8395   tmp = __builtin_expect((long )(! (! (sg->refcnt >= 1))), 1L);   8476   tmp = __builtin_expect((long )(! (! (sg->refcnt >= 1))), 1L);
8396   if (tmp) {   8477   if (tmp) {
8397     8478  
8398   } else {   8479   } else {
8399     vgPlain_assert_fail((Bool )0, (Char const   *)"sg->refcnt >= 1",   8480     vgPlain_assert_fail((Bool )0, (Char const   *)"sg->refcnt >= 1",
8400                         (Char const   *)"drd_segment.c", 191,   8481                         (Char const   *)"drd_segment.c", 191,
8401                         (Char const   *)"vgDrd_sg_put", "");   8482                         (Char const   *)"vgDrd_sg_put", "");
8402   }   8483   }
8403   (sg->refcnt) --;   8484   (sg->refcnt) --;
8404   if (sg->refcnt == 0) {   8485   if (sg->refcnt == 0) {
8405     vgDrd_sg_delete(sg);   8486     vgDrd_sg_delete(sg);
8406   } else {   8487   } else {
8407     8488  
8408   }   8489   }
8409   return;   8490   return;
8410 }   8491 }
8411 }   8492 }
8412 void vgDrd_sg_merge(Segment * const  sg1 , Segment * const  sg2 )   8493 void vgDrd_sg_merge(Segment * const  sg1 , Segment * const  sg2 )
8413 {   8494 {
8414   long tmp ;   8495   long tmp ;
8415   long tmp___0 ;   8496   long tmp___0 ;
8416   long tmp___1 ;   8497   long tmp___1 ;
8417   long tmp___2 ;   8498   long tmp___2 ;
8418   char *vc1 ;   8499   char *vc1 ;
8419   char *vc2 ;   8500   char *vc2 ;
8420     8501  
8421   {   8502   {
8422   tmp = __builtin_expect((long )(! (! sg1)), 1L);   8503   tmp = __builtin_expect((long )(! (! sg1)), 1L);
8423   if (tmp) {   8504   if (tmp) {
8424     8505  
8425   } else {   8506   } else {
8426     vgPlain_assert_fail((Bool )0, (Char const   *)"sg1",   8507     vgPlain_assert_fail((Bool )0, (Char const   *)"sg1",
8427                         (Char const   *)"drd_segment.c", 202,   8508                         (Char const   *)"drd_segment.c", 202,
8428                         (Char const   *)"vgDrd_sg_merge", "");   8509                         (Char const   *)"vgDrd_sg_merge", "");
8429   }   8510   }
8430   tmp___0 = __builtin_expect((long )(! (! (sg1->refcnt == 1))), 1L);   8511   tmp___0 = __builtin_expect((long )(! (! (sg1->refcnt == 1))), 1L);
8431   if (tmp___0) {   8512   if (tmp___0) {
8432     8513  
8433   } else {   8514   } else {
8434     vgPlain_assert_fail((Bool )0, (Char const   *)"sg1->refcnt == 1",   8515     vgPlain_assert_fail((Bool )0, (Char const   *)"sg1->refcnt == 1",
8435                         (Char const   *)"drd_segment.c", 203,   8516                         (Char const   *)"drd_segment.c", 203,
8436                         (Char const   *)"vgDrd_sg_merge", "");   8517                         (Char const   *)"vgDrd_sg_merge", "");
8437   }   8518   }
8438   tmp___1 = __builtin_expect((long )(! (! sg2)), 1L);   8519   tmp___1 = __builtin_expect((long )(! (! sg2)), 1L);
8439   if (tmp___1) {   8520   if (tmp___1) {
8440     8521  
8441   } else {   8522   } else {
8442     vgPlain_assert_fail((Bool )0, (Char const   *)"sg2",   8523     vgPlain_assert_fail((Bool )0, (Char const   *)"sg2",
8443                         (Char const   *)"drd_segment.c", 204,   8524                         (Char const   *)"drd_segment.c", 204,
8444                         (Char const   *)"vgDrd_sg_merge", "");   8525                         (Char const   *)"vgDrd_sg_merge", "");
8445   }   8526   }
8446   tmp___2 = __builtin_expect((long )(! (! (sg2->refcnt == 1))), 1L);   8527   tmp___2 = __builtin_expect((long )(! (! (sg2->refcnt == 1))), 1L);
8447   if (tmp___2) {   8528   if (tmp___2) {
8448     8529  
8449   } else {   8530   } else {
8450     vgPlain_assert_fail((Bool )0, (Char const   *)"sg2->refcnt == 1",   8531     vgPlain_assert_fail((Bool )0, (Char const   *)"sg2->refcnt == 1",
8451                         (Char const   *)"drd_segment.c", 205,   8532                         (Char const   *)"drd_segment.c", 205,
8452                         (Char const   *)"vgDrd_sg_merge", "");   8533                         (Char const   *)"vgDrd_sg_merge", "");
8453   }   8534   }
8454   if (s_trace_segment) {   8535   if (s_trace_segment) {
8455     vc1 = vgDrd_vc_aprint((VectorClock const   */* const  */)(& sg1->vc));   8536     vc1 = vgDrd_vc_aprint((VectorClock const   */* const  */)(& sg1->vc));
8456     vc2 = vgDrd_vc_aprint((VectorClock const   */* const  */)(& sg2->vc));   8537     vc2 = vgDrd_vc_aprint((VectorClock const   */* const  */)(& sg2->vc));
8457     vgPlain_message((VgMsgKind )2,   8538     vgPlain_message((VgMsgKind )2,
8458                     "Merging segments with vector clocks %s and %s\n", vc1, vc2);   8539                     "Merging segments with vector clocks %s and %s\n", vc1, vc2);
8459     vgPlain_free((void *)vc1);   8540     vgPlain_free((void *)vc1);
8460     vgPlain_free((void *)vc2);   8541     vgPlain_free((void *)vc2);
8461   } else {   8542   } else {
8462     8543  
8463   }   8544   }
8464   s_segment_merge_count ++;   8545   s_segment_merge_count ++;
8465   vgDrd_bm_merge2((struct bitmap */* const  */)(& sg1->bm),   8546   vgDrd_bm_merge2((struct bitmap */* const  */)(& sg1->bm),
8466                   (struct bitmap */* const  */)(& sg2->bm));   8547                   (struct bitmap */* const  */)(& sg2->bm));
8467   return;   8548   return;
8468 }   8549 }
8469 }   8550 }
8470 void vgDrd_sg_print(Segment * const  sg )   8551 void vgDrd_sg_print(Segment * const  sg )
8471 {   8552 {
8472   long tmp ;   8553   long tmp ;
8473     8554  
8474   {   8555   {
8475   tmp = __builtin_expect((long )(! (! sg)), 1L);   8556   tmp = __builtin_expect((long )(! (! sg)), 1L);
8476   if (tmp) {   8557   if (tmp) {
8477     8558  
8478   } else {   8559   } else {
8479     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",   8560     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",
8480                         (Char const   *)"drd_segment.c", 231,   8561                         (Char const   *)"drd_segment.c", 231,
8481                         (Char const   *)"vgDrd_sg_print", "");   8562                         (Char const   *)"vgDrd_sg_print", "");
8482   }   8563   }
8483   vgPlain_printf("vc: ");   8564   vgPlain_printf("vc: ");
8484   vgDrd_vc_print((VectorClock const   */* const  */)(& sg->vc));   8565   vgDrd_vc_print((VectorClock const   */* const  */)(& sg->vc));
8485   vgPlain_printf("\n");   8566   vgPlain_printf("\n");
8486   vgDrd_bm_print((struct bitmap */* const  */)(& sg->bm));   8567   vgDrd_bm_print((struct bitmap */* const  */)(& sg->bm));
8487   return;   8568   return;
8488 }   8569 }
8489 }   8570 }
8490 Bool vgDrd_sg_get_trace(void)   8571 Bool vgDrd_sg_get_trace(void)
8491 {   8572 {
8492     8573  
8493     8574  
8494   {   8575   {
8495   return (s_trace_segment);   8576   return (s_trace_segment);
8496 }   8577 }
8497 }   8578 }
8498 void vgDrd_sg_set_trace(Bool const   trace_segment )   8579 void vgDrd_sg_set_trace(Bool const   trace_segment )
8499 {   8580 {
8500   int tmp ;   8581   int tmp ;
8501   long tmp___0 ;   8582   long tmp___0 ;
8502     8583  
8503   {   8584   {
8504   if ((int const   )trace_segment == 0) {   8585   if ((int const   )trace_segment == 0) {
8505     tmp = 1;   8586     tmp = 1;
8506   } else   8587   } else
8507   if ((int const   )trace_segment == 1) {   8588   if ((int const   )trace_segment == 1) {
8508     tmp = 1;   8589     tmp = 1;
8509   } else {   8590   } else {
8510     tmp = 0;   8591     tmp = 0;
8511   }   8592   }
8512   tmp___0 = __builtin_expect((long )tmp, 1L);   8593   tmp___0 = __builtin_expect((long )tmp, 1L);
8513   if (tmp___0) {   8594   if (tmp___0) {
8514     8595  
8515   } else {   8596   } else {
8516     vgPlain_assert_fail((Bool )0,   8597     vgPlain_assert_fail((Bool )0,
8517                         (Char const   *)"trace_segment == False || trace_segment == True",   8598                         (Char const   *)"trace_segment == False || trace_segment == True",
8518                         (Char const   *)"drd_segment.c", 247,   8599                         (Char const   *)"drd_segment.c", 247,
8519                         (Char const   *)"vgDrd_sg_set_trace", "");   8600                         (Char const   *)"vgDrd_sg_set_trace", "");
8520   }   8601   }
8521   s_trace_segment = (Bool )trace_segment;   8602   s_trace_segment = (Bool )trace_segment;
8522   return;   8603   return;
8523 }   8604 }
8524 }   8605 }
8525 ULong vgDrd_sg_get_segments_created_count(void)   8606 ULong vgDrd_sg_get_segments_created_count(void)
8526 {   8607 {
8527     8608  
8528     8609  
8529   {   8610   {
8530   return (s_segments_created_count);   8611   return (s_segments_created_count);
8531 }   8612 }
8532 }   8613 }
8533 ULong vgDrd_sg_get_segments_alive_count(void)   8614 ULong vgDrd_sg_get_segments_alive_count(void)
8534 {   8615 {
8535     8616  
8536     8617  
8537   {   8618   {
8538   return (s_segments_alive_count);   8619   return (s_segments_alive_count);
8539 }   8620 }
8540 }   8621 }
8541 ULong vgDrd_sg_get_max_segments_alive_count(void)   8622 ULong vgDrd_sg_get_max_segments_alive_count(void)
8542 {   8623 {
8543     8624  
8544     8625  
8545   {   8626   {
8546   return (s_max_segments_alive_count);   8627   return (s_max_segments_alive_count);
8547 }   8628 }
8548 }   8629 }
8549 ULong vgDrd_sg_get_segment_merge_count(void)   8630 ULong vgDrd_sg_get_segment_merge_count(void)
8550 {   8631 {
8551     8632  
8552     8633  
8553   {   8634   {
8554   return (s_segment_merge_count);   8635   return (s_segment_merge_count);
8555 }   8636 }
8556 }   8637 }
8557 static int ( /* format attribute */  VALGRIND_PRINTF)(char const   *format   8638 static int ( /* format attribute */  VALGRIND_PRINTF)(char const   *format
8558                                                       , ...)  __attribute__((__unused__)) ;   8639                                                       , ...)  __attribute__((__unused__)) ;
8559 static int ( /* format attribute */  VALGRIND_PRINTF)(char const   *format   8640 static int ( /* format attribute */  VALGRIND_PRINTF)(char const   *format
8560                                                       , ...)  __attribute__((__unused__)) ;   8641                                                       , ...)  __attribute__((__unused__)) ;
8561 static int ( /* format attribute */  VALGRIND_PRINTF)(char const   *format   8642 static int ( /* format attribute */  VALGRIND_PRINTF)(char const   *format
8562                                                       , ...)   8643                                                       , ...)
8563 {   8644 {
8564   unsigned long _qzz_res ;   8645   unsigned long _qzz_res ;
8565   va_list vargs ;   8646   va_list vargs ;
8566   unsigned int volatile   _zzq_args[6] ;   8647   unsigned int volatile   _zzq_args[6] ;
8567   unsigned int volatile   _zzq_result ;   8648   unsigned int volatile   _zzq_result ;
8568     8649  
8569   {   8650   {
8570   __builtin_va_start(vargs, format);   8651   __builtin_va_start(vargs, format);
8571   _zzq_args[0] = (unsigned int volatile   )5123U;   8652   _zzq_args[0] = (unsigned int volatile   )5123U;
8572   _zzq_args[1] = (unsigned int volatile   )((unsigned int )((unsigned long )format));   8653   _zzq_args[1] = (unsigned int volatile   )((unsigned int )((unsigned long )format));
8573   _zzq_args[2] = (unsigned int volatile   )((unsigned int )((unsigned long )(& vargs)));   8654   _zzq_args[2] = (unsigned int volatile   )((unsigned int )((unsigned long )(& vargs)));
8574   _zzq_args[3] = (unsigned int volatile   )0U;   8655   _zzq_args[3] = (unsigned int volatile   )0U;
8575   _zzq_args[4] = (unsigned int volatile   )0U;   8656   _zzq_args[4] = (unsigned int volatile   )0U;
8576   _zzq_args[5] = (unsigned int volatile   )0U;   8657   _zzq_args[5] = (unsigned int volatile   )0U;
8577   __asm__  volatile   ("roll $3,  %%edi ; roll $13, %%edi\n\t"   8658   __asm__  volatile   ("roll $3,  %%edi ; roll $13, %%edi\n\t"
8578                        "roll $29, %%edi ; roll $19, %%edi\n\t"   8659                        "roll $29, %%edi ; roll $19, %%edi\n\t"
8579                        "xchgl %%ebx,%%ebx": "=d" (_zzq_result): "a" (& _zzq_args[0]),   8660                        "xchgl %%ebx,%%ebx": "=d" (_zzq_result): "a" (& _zzq_args[0]),
8580                        "0" (0): "cc", "memory");   8661                        "0" (0): "cc", "memory");
8581   _qzz_res = (unsigned long )_zzq_result;   8662   _qzz_res = (unsigned long )_zzq_result;
8582   __builtin_va_end(vargs);   8663   __builtin_va_end(vargs);
8583   return ((int )_qzz_res);   8664   return ((int )_qzz_res);
8584 }   8665 }
8585 }   8666 }
8586 static int ( /* format attribute */  VALGRIND_PRINTF_BACKTRACE)(char const   *format   8667 static int ( /* format attribute */  VALGRIND_PRINTF_BACKTRACE)(char const   *format
8587                                                                 , ...)  __attribute__((__unused__)) ;   8668                                                                 , ...)  __attribute__((__unused__)) ;
8588 static int ( /* format attribute */  VALGRIND_PRINTF_BACKTRACE)(char const   *format   8669 static int ( /* format attribute */  VALGRIND_PRINTF_BACKTRACE)(char const   *format
8589                                                                 , ...)  __attribute__((__unused__)) ;   8670                                                                 , ...)  __attribute__((__unused__)) ;
8590 static int ( /* format attribute */  VALGRIND_PRINTF_BACKTRACE)(char const   *format   8671 static int ( /* format attribute */  VALGRIND_PRINTF_BACKTRACE)(char const   *format
8591                                                                 , ...)   8672                                                                 , ...)
8592 {   8673 {
8593   unsigned long _qzz_res ;   8674   unsigned long _qzz_res ;
8594   va_list vargs ;   8675   va_list vargs ;
8595   unsigned int volatile   _zzq_args[6] ;   8676   unsigned int volatile   _zzq_args[6] ;
8596   unsigned int volatile   _zzq_result ;   8677   unsigned int volatile   _zzq_result ;
8597     8678  
8598   {   8679   {
8599   __builtin_va_start(vargs, format);   8680   __builtin_va_start(vargs, format);
8600   _zzq_args[0] = (unsigned int volatile   )5124U;   8681   _zzq_args[0] = (unsigned int volatile   )5124U;
8601   _zzq_args[1] = (unsigned int volatile   )((unsigned int )((unsigned long )format));   8682   _zzq_args[1] = (unsigned int volatile   )((unsigned int )((unsigned long )format));
8602   _zzq_args[2] = (unsigned int volatile   )((unsigned int )((unsigned long )(& vargs)));   8683   _zzq_args[2] = (unsigned int volatile   )((unsigned int )((unsigned long )(& vargs)));
8603   _zzq_args[3] = (unsigned int volatile   )0U;   8684   _zzq_args[3] = (unsigned int volatile   )0U;
8604   _zzq_args[4] = (unsigned int volatile   )0U;   8685   _zzq_args[4] = (unsigned int volatile   )0U;
8605   _zzq_args[5] = (unsigned int volatile   )0U;   8686   _zzq_args[5] = (unsigned int volatile   )0U;
8606   __asm__  volatile   ("roll $3,  %%edi ; roll $13, %%edi\n\t"   8687   __asm__  volatile   ("roll $3,  %%edi ; roll $13, %%edi\n\t"
8607                        "roll $29, %%edi ; roll $19, %%edi\n\t"   8688                        "roll $29, %%edi ; roll $19, %%edi\n\t"
8608                        "xchgl %%ebx,%%ebx": "=d" (_zzq_result): "a" (& _zzq_args[0]),   8689                        "xchgl %%ebx,%%ebx": "=d" (_zzq_result): "a" (& _zzq_args[0]),
8609                        "0" (0): "cc", "memory");   8690                        "0" (0): "cc", "memory");
8610   _qzz_res = (unsigned long )_zzq_result;   8691   _qzz_res = (unsigned long )_zzq_result;
8611   __builtin_va_end(vargs);   8692   __builtin_va_end(vargs);
8612   return ((int )_qzz_res);   8693   return ((int )_qzz_res);
8613 }   8694 }
8614 }   8695 }
8615 extern Bool vgDrd_g_free_is_write ;   8696 extern Bool vgDrd_g_free_is_write ;
8616 extern void vgDrd_clientreq_init(void) ;   8697 extern void vgDrd_clientreq_init(void) ;
8617 extern void vgDrd_barrier_set_trace(Bool const   trace_barrier ) ;   8698 extern void vgDrd_barrier_set_trace(Bool const   trace_barrier ) ;
8618 extern void vgDrd_barrier_init(Addr const   barrier ,   8699 extern void vgDrd_barrier_init(Addr const   barrier ,
8619                                BarrierT const   barrier_type ,   8700                                BarrierT const   barrier_type ,
8620                                Word const   count ,   8701                                Word const   count ,
8621                                Bool const   reinitialization ) ;   8702                                Bool const   reinitialization ) ;
8622 extern void vgDrd_barrier_destroy(Addr const   barrier ,   8703 extern void vgDrd_barrier_destroy(Addr const   barrier ,
8623                                   BarrierT const   barrier_type ) ;   8704                                   BarrierT const   barrier_type ) ;
8624 extern void vgDrd_barrier_pre_wait(DrdThreadId const   tid ,   8705 extern void vgDrd_barrier_pre_wait(DrdThreadId const   tid ,
8625                                    Addr const   barrier ,   8706                                    Addr const   barrier ,
8626                                    BarrierT const   barrier_type ) ;   8707                                    BarrierT const   barrier_type ) ;
8627 extern void vgDrd_barrier_post_wait(DrdThreadId const   tid ,   8708 extern void vgDrd_barrier_post_wait(DrdThreadId const   tid ,
8628                                     Addr const   barrier ,   8709                                     Addr const   barrier ,
8629                                     BarrierT const   barrier_type ,   8710                                     BarrierT const   barrier_type ,
8630                                     Bool const   waited ,   8711                                     Bool const   waited ,
8631                                     Bool const   serializing ) ;   8712                                     Bool const   serializing ) ;
8632 extern void vgDrd_barrier_stop_using_mem(Addr const   a1 , Addr const   a2 ) ;   8713 extern void vgDrd_barrier_stop_using_mem(Addr const   a1 , Addr const   a2 ) ;
8633 extern ULong vgDrd_get_barrier_segment_creation_count(void) ;   8714 extern ULong vgDrd_get_barrier_segment_creation_count(void) ;
8634 extern XArray *vgPlain_newXA(void *(*alloc_fn)(HChar * , SizeT  ) , HChar *cc ,   8715 extern XArray *vgPlain_newXA(void *(*alloc_fn)(HChar * , SizeT  ) , HChar *cc ,
8635                              void (*free_fn)(void * ) , Word elemSzB ) ;   8716                              void (*free_fn)(void * ) , Word elemSzB ) ;
8636 extern void vgPlain_deleteXA(XArray * ) ;   8717 extern void vgPlain_deleteXA(XArray * ) ;
8637 extern void vgPlain_setCmpFnXA(XArray * , Int (*compar)(void * , void * ) ) ;   8718 extern void vgPlain_setCmpFnXA(XArray * , Int (*compar)(void * , void * ) ) ;
8638 extern Word vgPlain_addToXA(XArray * , void *elem ) ;   8719 extern Word vgPlain_addToXA(XArray * , void *elem ) ;
8639 extern Word vgPlain_addBytesToXA(XArray *xao , void *bytesV , Word nbytes ) ;   8720 extern Word vgPlain_addBytesToXA(XArray *xao , void *bytesV , Word nbytes ) ;
8640 extern void vgPlain_sortXA(XArray * ) ;   8721 extern void vgPlain_sortXA(XArray * ) ;
8641 extern Bool vgPlain_lookupXA(XArray * , void *key , Word *first , Word *last ) ;   8722 extern Bool vgPlain_lookupXA(XArray * , void *key , Word *first , Word *last ) ;
8642 extern Bool vgPlain_lookupXA_UNSAFE(XArray *xao , void *key , Word *first ,   8723 extern Bool vgPlain_lookupXA_UNSAFE(XArray *xao , void *key , Word *first ,
8643                                     Word *last , Int (*cmpFn)(void * , void * ) ) ;   8724                                     Word *last , Int (*cmpFn)(void * , void * ) ) ;
8644 extern Word vgPlain_sizeXA(XArray * ) ;   8725 extern Word vgPlain_sizeXA(XArray * ) ;
8645 extern void *vgPlain_indexXA(XArray * , Word  ) ;   8726 extern void *vgPlain_indexXA(XArray * , Word  ) ;
8646 extern void vgPlain_dropTailXA(XArray * , Word  ) ;   8727 extern void vgPlain_dropTailXA(XArray * , Word  ) ;
8647 extern void vgPlain_dropHeadXA(XArray * , Word  ) ;   8728 extern void vgPlain_dropHeadXA(XArray * , Word  ) ;
8648 extern XArray *vgPlain_cloneXA(HChar *cc , XArray *xa ) ;   8729 extern XArray *vgPlain_cloneXA(HChar *cc , XArray *xa ) ;
8649 extern void vgPlain_getContentsXA_UNSAFE(XArray *sr , void **ctsP , Word *usedP ) ;   8730 extern void vgPlain_getContentsXA_UNSAFE(XArray *sr , void **ctsP , Word *usedP ) ;
8650 extern void ( /* format attribute */  vgPlain_xaprintf)(XArray *dst ,   8731 extern void ( /* format attribute */  vgPlain_xaprintf)(XArray *dst ,
8651                                                         HChar const   *format   8732                                                         HChar const   *format
8652                                                         , ...) ;   8733                                                         , ...) ;
8653 extern void vgDrd_clientobj_set_trace(Bool const   trace ) ;   8734 extern void vgDrd_clientobj_set_trace(Bool const   trace ) ;
8654 extern void vgDrd_clientobj_init(void) ;   8735 extern void vgDrd_clientobj_init(void) ;
8655 extern void vgDrd_clientobj_cleanup(void) ;   8736 extern void vgDrd_clientobj_cleanup(void) ;
8656 extern DrdClientobj *vgDrd_clientobj_get_any(Addr const   addr ) ;   8737 extern DrdClientobj *vgDrd_clientobj_get_any(Addr const   addr ) ;
8657 extern DrdClientobj *vgDrd_clientobj_get(Addr const   addr , ObjType const   t ) ;   8738 extern DrdClientobj *vgDrd_clientobj_get(Addr const   addr , ObjType const   t ) ;
8658 extern Bool vgDrd_clientobj_present(Addr const   a1 , Addr const   a2 ) ;   8739 extern Bool vgDrd_clientobj_present(Addr const   a1 , Addr const   a2 ) ;
8659 extern DrdClientobj *vgDrd_clientobj_add(Addr const   a1 , ObjType const   t ) ;   8740 extern DrdClientobj *vgDrd_clientobj_add(Addr const   a1 , ObjType const   t ) ;
8660 extern Bool vgDrd_clientobj_remove(Addr const   addr , ObjType const   t ) ;   8741 extern Bool vgDrd_clientobj_remove(Addr const   addr , ObjType const   t ) ;
8661 extern void vgDrd_clientobj_stop_using_mem(Addr const   a1 , Addr const   a2 ) ;   8742 extern void vgDrd_clientobj_stop_using_mem(Addr const   a1 , Addr const   a2 ) ;
8662 extern void vgDrd_clientobj_delete_thread(DrdThreadId const   tid ) ;   8743 extern void vgDrd_clientobj_delete_thread(DrdThreadId const   tid ) ;
8663 extern char const   *vgDrd_clientobj_type_name(ObjType const   t ) ;   8744 extern char const   *vgDrd_clientobj_type_name(ObjType const   t ) ;
8664 extern Addr vgDrd_pthread_cond_initializer ;   8745 extern Addr vgDrd_pthread_cond_initializer ;
8665 extern int vgDrd_pthread_cond_initializer_size ;   8746 extern int vgDrd_pthread_cond_initializer_size ;
8666 extern void vgDrd_cond_set_report_signal_unlocked(Bool const   r ) ;   8747 extern void vgDrd_cond_set_report_signal_unlocked(Bool const   r ) ;
8667 extern void vgDrd_cond_set_trace(Bool const   trace_cond ) ;   8748 extern void vgDrd_cond_set_trace(Bool const   trace_cond ) ;
8668 extern struct cond_info *vgDrd_cond_get(Addr const   cond ) ;   8749 extern struct cond_info *vgDrd_cond_get(Addr const   cond ) ;
8669 extern void vgDrd_cond_pre_init(Addr const   cond ) ;   8750 extern void vgDrd_cond_pre_init(Addr const   cond ) ;
8670 extern void vgDrd_cond_post_destroy(Addr const   cond ) ;   8751 extern void vgDrd_cond_post_destroy(Addr const   cond ) ;
8671 extern void vgDrd_cond_pre_wait(Addr const   cond , Addr const   mutex ) ;   8752 extern void vgDrd_cond_pre_wait(Addr const   cond , Addr const   mutex ) ;
8672 extern void vgDrd_cond_post_wait(Addr const   cond ) ;   8753 extern void vgDrd_cond_post_wait(Addr const   cond ) ;
8673 extern void vgDrd_cond_pre_signal(Addr const   cond ) ;   8754 extern void vgDrd_cond_pre_signal(Addr const   cond ) ;
8674 extern void vgDrd_cond_pre_broadcast(Addr const   cond ) ;   8755 extern void vgDrd_cond_pre_broadcast(Addr const   cond ) ;
8675 extern void vgDrd_mutex_set_trace(Bool const   trace_mutex ) ;   8756 extern void vgDrd_mutex_set_trace(Bool const   trace_mutex ) ;
8676 extern void vgDrd_mutex_set_lock_threshold(UInt const   lock_threshold_ms ) ;   8757 extern void vgDrd_mutex_set_lock_threshold(UInt const   lock_threshold_ms ) ;
8677 extern struct mutex_info *vgDrd_mutex_init(Addr const   mutex ,   8758 extern struct mutex_info *vgDrd_mutex_init(Addr const   mutex ,
8678                                            MutexT const   mutex_type ) ;   8759                                            MutexT const   mutex_type ) ;
8679 extern void vgDrd_mutex_post_destroy(Addr const   mutex ) ;   8760 extern void vgDrd_mutex_post_destroy(Addr const   mutex ) ;
8680 extern void vgDrd_not_a_mutex(Addr const   mutex ) ;   8761 extern void vgDrd_not_a_mutex(Addr const   mutex ) ;
8681 extern struct mutex_info *vgDrd_mutex_get(Addr const   mutex ) ;   8762 extern struct mutex_info *vgDrd_mutex_get(Addr const   mutex ) ;
8682 extern void vgDrd_mutex_pre_lock(Addr const   mutex ,   8763 extern void vgDrd_mutex_pre_lock(Addr const   mutex ,
8683                                  MutexT const   mutex_type ,   8764                                  MutexT const   mutex_type ,
8684                                  Bool const   trylock ) ;   8765                                  Bool const   trylock ) ;
8685 extern void vgDrd_mutex_post_lock(Addr const   mutex , Bool const   took_lock ,   8766 extern void vgDrd_mutex_post_lock(Addr const   mutex , Bool const   took_lock ,
8686                                   Bool const   post_cond_wait ) ;   8767                                   Bool const   post_cond_wait ) ;
8687 extern void vgDrd_mutex_unlock(Addr const   mutex , MutexT const   mutex_type ) ;   8768 extern void vgDrd_mutex_unlock(Addr const   mutex , MutexT const   mutex_type ) ;
8688 extern void vgDrd_spinlock_init_or_unlock(Addr const   spinlock ) ;   8769 extern void vgDrd_spinlock_init_or_unlock(Addr const   spinlock ) ;
8689 extern char const   *vgDrd_mutex_get_typename(struct mutex_info * const  p ) ;   8770 extern char const   *vgDrd_mutex_get_typename(struct mutex_info * const  p ) ;
8690 extern char const   *vgDrd_mutex_type_name(MutexT const   mt ) ;   8771 extern char const   *vgDrd_mutex_type_name(MutexT const   mt ) ;
8691 extern Bool vgDrd_mutex_is_locked_by(Addr const   mutex ,   8772 extern Bool vgDrd_mutex_is_locked_by(Addr const   mutex ,
8692                                      DrdThreadId const   tid ) ;   8773                                      DrdThreadId const   tid ) ;
8693 extern int vgDrd_mutex_get_recursion_count(Addr const   mutex ) ;   8774 extern int vgDrd_mutex_get_recursion_count(Addr const   mutex ) ;
8694 extern ULong vgDrd_get_mutex_lock_count(void) ;   8775 extern ULong vgDrd_get_mutex_lock_count(void) ;
8695 extern ULong vgDrd_get_mutex_segment_creation_count(void) ;   8776 extern ULong vgDrd_get_mutex_segment_creation_count(void) ;
8696 extern void vgDrd_semaphore_set_trace(Bool const   trace_semaphore ) ;   8777 extern void vgDrd_semaphore_set_trace(Bool const   trace_semaphore ) ;
8697 extern struct semaphore_info *vgDrd_semaphore_init(Addr const   semaphore ,   8778 extern struct semaphore_info *vgDrd_semaphore_init(Addr const   semaphore ,
8698                                                    Word const   pshared ,   8779                                                    Word const   pshared ,
8699                                                    UInt const   value ) ;   8780                                                    UInt const   value ) ;
8700 extern void vgDrd_semaphore_destroy(Addr const   semaphore ) ;   8781 extern void vgDrd_semaphore_destroy(Addr const   semaphore ) ;
8701 extern struct semaphore_info *vgDrd_semaphore_open(Addr const   semaphore ,   8782 extern struct semaphore_info *vgDrd_semaphore_open(Addr const   semaphore ,
8702                                                    Char const   *name ,   8783                                                    Char const   *name ,
8703                                                    Word const   oflag ,   8784                                                    Word const   oflag ,
8704                                                    Word const   mode ,   8785                                                    Word const   mode ,
8705                                                    UInt const   value ) ;   8786                                                    UInt const   value ) ;
8706 extern void vgDrd_semaphore_close(Addr const   semaphore ) ;   8787 extern void vgDrd_semaphore_close(Addr const   semaphore ) ;
8707 extern void vgDrd_semaphore_pre_wait(Addr const   semaphore ) ;   8788 extern void vgDrd_semaphore_pre_wait(Addr const   semaphore ) ;
8708 extern void vgDrd_semaphore_post_wait(DrdThreadId const   tid ,   8789 extern void vgDrd_semaphore_post_wait(DrdThreadId const   tid ,
8709                                       Addr const   semaphore ,   8790                                       Addr const   semaphore ,
8710                                       Bool const   waited ) ;   8791                                       Bool const   waited ) ;
8711 extern void vgDrd_semaphore_pre_post(DrdThreadId const   tid ,   8792 extern void vgDrd_semaphore_pre_post(DrdThreadId const   tid ,
8712                                      Addr const   semaphore ) ;   8793                                      Addr const   semaphore ) ;
8713 extern void vgDrd_semaphore_post_post(DrdThreadId const   tid ,   8794 extern void vgDrd_semaphore_post_post(DrdThreadId const   tid ,
8714                                       Addr const   semaphore ,   8795                                       Addr const   semaphore ,
8715                                       Bool const   waited ) ;   8796                                       Bool const   waited ) ;
8716 extern ULong vgDrd_get_semaphore_segment_creation_count(void) ;   8797 extern ULong vgDrd_get_semaphore_segment_creation_count(void) ;
8717 __inline static struct vki_cmsghdr *__vki_cmsg_nxthdr(void *__ctl ,   8798 __inline static struct vki_cmsghdr *__vki_cmsg_nxthdr(void *__ctl ,
8718                                                       __vki_kernel_size_t __size ,   8799                                                       __vki_kernel_size_t __size ,
8719                                                       struct vki_cmsghdr *__cmsg )   8800                                                       struct vki_cmsghdr *__cmsg )
8720 {   8801 {
8721   struct vki_cmsghdr *__ptr ;   8802   struct vki_cmsghdr *__ptr ;
8722     8803  
8723   {   8804   {
8724   __ptr = (struct vki_cmsghdr *)((unsigned char *)__cmsg + (((__cmsg->cmsg_len + sizeof(long )) - 1U) & ~ (sizeof(long ) - 1U)));   8805   __ptr = (struct vki_cmsghdr *)((unsigned char *)__cmsg + (((__cmsg->cmsg_len + sizeof(long )) - 1U) & ~ (sizeof(long ) - 1U)));
8725   if ((unsigned long )((char *)(__ptr + 1) - (char *)__ctl) > (unsigned long )__size) {   8806   if ((unsigned long )((char *)(__ptr + 1) - (char *)__ctl) > (unsigned long )__size) {
8726     return ((struct vki_cmsghdr *)0);   8807     return ((struct vki_cmsghdr *)0);
8727   } else {   8808   } else {
8728     8809  
8729   }   8810   }
8730   return (__ptr);   8811   return (__ptr);
8731 }   8812 }
8732 }   8813 }
8733 __inline static struct vki_cmsghdr *vki_cmsg_nxthdr(struct vki_msghdr *__msg ,   8814 __inline static struct vki_cmsghdr *vki_cmsg_nxthdr(struct vki_msghdr *__msg ,
8734                                                     struct vki_cmsghdr *__cmsg )   8815                                                     struct vki_cmsghdr *__cmsg )
8735 {   8816 {
8736   struct vki_cmsghdr *tmp ;   8817   struct vki_cmsghdr *tmp ;
8737     8818  
8738   {   8819   {
8739   tmp = __vki_cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);   8820   tmp = __vki_cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
8740   return (tmp);   8821   return (tmp);
8741 }   8822 }
8742 }   8823 }
8743 extern Char **vgPlain_client_envp ;   8824 extern Char **vgPlain_client_envp ;
8744 extern Char *vgPlain_getenv(Char *name ) ;   8825 extern Char *vgPlain_getenv(Char *name ) ;
8745 extern Char const   *vgPlain_libdir ;   8826 extern Char const   *vgPlain_libdir ;
8746 extern Char const   *vgPlain_LD_PRELOAD_var_name ;   8827 extern Char const   *vgPlain_LD_PRELOAD_var_name ;
8747 extern Int vgPlain_waitpid(Int pid , Int *status , Int options ) ;   8828 extern Int vgPlain_waitpid(Int pid , Int *status , Int options ) ;
8748 extern Int vgPlain_system(Char *cmd ) ;   8829 extern Int vgPlain_system(Char *cmd ) ;
8749 extern Int vgPlain_fork(void) ;   8830 extern Int vgPlain_fork(void) ;
8750 extern void vgPlain_execv(Char *filename , Char **argv ) ;   8831 extern void vgPlain_execv(Char *filename , Char **argv ) ;
8751 extern Int vgPlain_getrlimit(Int resource , struct vki_rlimit *rlim ) ;   8832 extern Int vgPlain_getrlimit(Int resource , struct vki_rlimit *rlim ) ;
8752 extern Int vgPlain_setrlimit(Int resource , struct vki_rlimit  const  *rlim ) ;   8833 extern Int vgPlain_setrlimit(Int resource , struct vki_rlimit  const  *rlim ) ;
8753 extern Int vgPlain_prctl(Int option , ULong arg2 , ULong arg3 , ULong arg4 ,   8834 extern Int vgPlain_prctl(Int option , ULong arg2 , ULong arg3 , ULong arg4 ,
8754                          ULong arg5 ) ;   8835                          ULong arg5 ) ;
8755 extern Int vgPlain_gettid(void) ;   8836 extern Int vgPlain_gettid(void) ;
8756 extern Int vgPlain_getpid(void) ;   8837 extern Int vgPlain_getpid(void) ;
8757 extern Int vgPlain_getppid(void) ;   8838 extern Int vgPlain_getppid(void) ;
8758 extern Int vgPlain_getpgrp(void) ;   8839 extern Int vgPlain_getpgrp(void) ;
8759 extern Int vgPlain_geteuid(void) ;   8840 extern Int vgPlain_geteuid(void) ;
8760 extern Int vgPlain_getegid(void) ;   8841 extern Int vgPlain_getegid(void) ;
8761 extern UInt vgPlain_read_millisecond_timer(void) ;   8842 extern UInt vgPlain_read_millisecond_timer(void) ;
8762 extern void vgPlain_atfork(void (*pre)(ThreadId  ) ,   8843 extern void vgPlain_atfork(void (*pre)(ThreadId  ) ,
8763                            void (*parent)(ThreadId  ) ,   8844                            void (*parent)(ThreadId  ) ,
8764                            void (*child)(ThreadId  ) ) ;   8845                            void (*child)(ThreadId  ) ) ;
8765 extern Int vgPlain_clo_verbosity ;   8846 extern Int vgPlain_clo_verbosity ;
8766 extern Bool vgPlain_clo_stats ;   8847 extern Bool vgPlain_clo_stats ;
8767 extern Int vgPlain_clo_vgdb_error ;   8848 extern Int vgPlain_clo_vgdb_error ;
8768 extern Bool vgPlain_clo_xml ;   8849 extern Bool vgPlain_clo_xml ;
8769 extern HChar *vgPlain_clo_xml_user_comment ;   8850 extern HChar *vgPlain_clo_xml_user_comment ;
8770 extern VexControl vgPlain_clo_vex_control ;   8851 extern VexControl vgPlain_clo_vex_control ;
8771 extern Int vgPlain_clo_backtrace_size ;   8852 extern Int vgPlain_clo_backtrace_size ;
8772 extern Bool vgPlain_clo_show_below_main ;   8853 extern Bool vgPlain_clo_show_below_main ;
8773 extern Char *vgPlain_expand_file_name(Char *option_name , Char *format ) ;   8854 extern Char *vgPlain_expand_file_name(Char *option_name , Char *format ) ;
8774 static void thread_append_segment(DrdThreadId const   tid , Segment * const  sg ) ;   8855 static void thread_append_segment(DrdThreadId const   tid , Segment * const  sg ) ;
8775 static void thread_discard_segment(DrdThreadId const   tid ,   8856 static void thread_discard_segment(DrdThreadId const   tid ,
8776                                    Segment * const  sg ) ;   8857                                    Segment * const  sg ) ;
8777 static void thread_compute_conflict_set(struct bitmap **conflict_set ,   8858 static void thread_compute_conflict_set(struct bitmap **conflict_set ,
8778                                         DrdThreadId const   tid ) ;   8859                                         DrdThreadId const   tid ) ;
8779 static Bool thread_conflict_set_up_to_date(DrdThreadId const   tid ) ;   8860 static Bool thread_conflict_set_up_to_date(DrdThreadId const   tid ) ;
8780 static ULong s_context_switch_count  ;   8861 static ULong s_context_switch_count  ;
8781 static ULong s_discard_ordered_segments_count  ;   8862 static ULong s_discard_ordered_segments_count  ;
8782 static ULong s_compute_conflict_set_count  ;   8863 static ULong s_compute_conflict_set_count  ;
8783 static ULong s_update_conflict_set_count  ;   8864 static ULong s_update_conflict_set_count  ;
8784 static ULong s_update_conflict_set_new_sg_count  ;   8865 static ULong s_update_conflict_set_new_sg_count  ;
8785 static ULong s_update_conflict_set_sync_count  ;   8866 static ULong s_update_conflict_set_sync_count  ;
8786 static ULong s_update_conflict_set_join_count  ;   8867 static ULong s_update_conflict_set_join_count  ;
8787 static ULong s_conflict_set_bitmap_creation_count  ;   8868 static ULong s_conflict_set_bitmap_creation_count  ;
8788 static ULong s_conflict_set_bitmap2_creation_count  ;   8869 static ULong s_conflict_set_bitmap2_creation_count  ;
8789 static ThreadId s_vg_running_tid  =    (ThreadId )0;   8870 static ThreadId s_vg_running_tid  =    (ThreadId )0;
8790 DrdThreadId vgDrd_g_drd_running_tid  =    (DrdThreadId )0;   8871 DrdThreadId vgDrd_g_drd_running_tid  =    (DrdThreadId )0;
8791 static Bool s_trace_context_switches  =    (Bool )0;   8872 static Bool s_trace_context_switches  =    (Bool )0;
8792 static Bool s_trace_conflict_set  =    (Bool )0;   8873 static Bool s_trace_conflict_set  =    (Bool )0;
8793 static Bool s_trace_conflict_set_bm  =    (Bool )0;   8874 static Bool s_trace_conflict_set_bm  =    (Bool )0;
8794 static Bool s_trace_fork_join  =    (Bool )0;   8875 static Bool s_trace_fork_join  =    (Bool )0;
8795 static Bool s_segment_merging  =    (Bool )1;   8876 static Bool s_segment_merging  =    (Bool )1;
8796 static Bool s_new_segments_since_last_merge  ;   8877 static Bool s_new_segments_since_last_merge  ;
8797 static int s_segment_merge_interval  =    10;   8878 static int s_segment_merge_interval  =    10;
8798 static unsigned int s_join_list_vol  =    10U;   8879 static unsigned int s_join_list_vol  =    10U;
8799 static unsigned int s_deletion_head  ;   8880 static unsigned int s_deletion_head  ;
8800 static unsigned int s_deletion_tail  ;   8881 static unsigned int s_deletion_tail  ;
8801 void vgDrd_thread_trace_context_switches(Bool const   t )   8882 void vgDrd_thread_trace_context_switches(Bool const   t )
8802 {   8883 {
8803   int tmp ;   8884   int tmp ;
8804   long tmp___0 ;   8885   long tmp___0 ;
8805     8886  
8806   {   8887   {
8807   if ((int const   )t == 0) {   8888   if ((int const   )t == 0) {
8808     tmp = 1;   8889     tmp = 1;
8809   } else   8890   } else
8810   if ((int const   )t == 1) {   8891   if ((int const   )t == 1) {
8811     tmp = 1;   8892     tmp = 1;
8812   } else {   8893   } else {
8813     tmp = 0;   8894     tmp = 0;
8814   }   8895   }
8815   tmp___0 = __builtin_expect((long )tmp, 1L);   8896   tmp___0 = __builtin_expect((long )tmp, 1L);
8816   if (tmp___0) {   8897   if (tmp___0) {
8817     8898  
8818   } else {   8899   } else {
8819     vgPlain_assert_fail((Bool )0, (Char const   *)"t == False || t == True",   8900     vgPlain_assert_fail((Bool )0, (Char const   *)"t == False || t == True",
8820                         (Char const   *)"drd_thread.c", 88,   8901                         (Char const   *)"drd_thread.c", 88,
8821                         (Char const   *)"vgDrd_thread_trace_context_switches",   8902                         (Char const   *)"vgDrd_thread_trace_context_switches",
8822                         "");   8903                         "");
8823   }   8904   }
8824   s_trace_context_switches = (Bool )t;   8905   s_trace_context_switches = (Bool )t;
8825   return;   8906   return;
8826 }   8907 }
8827 }   8908 }
8828 void vgDrd_thread_trace_conflict_set(Bool const   t )   8909 void vgDrd_thread_trace_conflict_set(Bool const   t )
8829 {   8910 {
8830   int tmp ;   8911   int tmp ;
8831   long tmp___0 ;   8912   long tmp___0 ;
8832     8913  
8833   {   8914   {
8834   if ((int const   )t == 0) {   8915   if ((int const   )t == 0) {
8835     tmp = 1;   8916     tmp = 1;
8836   } else   8917   } else
8837   if ((int const   )t == 1) {   8918   if ((int const   )t == 1) {
8838     tmp = 1;   8919     tmp = 1;
8839   } else {   8920   } else {
8840     tmp = 0;   8921     tmp = 0;
8841   }   8922   }
8842   tmp___0 = __builtin_expect((long )tmp, 1L);   8923   tmp___0 = __builtin_expect((long )tmp, 1L);
8843   if (tmp___0) {   8924   if (tmp___0) {
8844     8925  
8845   } else {   8926   } else {
8846     vgPlain_assert_fail((Bool )0, (Char const   *)"t == False || t == True",   8927     vgPlain_assert_fail((Bool )0, (Char const   *)"t == False || t == True",
8847                         (Char const   *)"drd_thread.c", 95,   8928                         (Char const   *)"drd_thread.c", 95,
8848                         (Char const   *)"vgDrd_thread_trace_conflict_set", "");   8929                         (Char const   *)"vgDrd_thread_trace_conflict_set", "");
8849   }   8930   }
8850   s_trace_conflict_set = (Bool )t;   8931   s_trace_conflict_set = (Bool )t;
8851   return;   8932   return;
8852 }   8933 }
8853 }   8934 }
8854 void vgDrd_thread_trace_conflict_set_bm(Bool const   t )   8935 void vgDrd_thread_trace_conflict_set_bm(Bool const   t )
8855 {   8936 {
8856   int tmp ;   8937   int tmp ;
8857   long tmp___0 ;   8938   long tmp___0 ;
8858     8939  
8859   {   8940   {
8860   if ((int const   )t == 0) {   8941   if ((int const   )t == 0) {
8861     tmp = 1;   8942     tmp = 1;
8862   } else   8943   } else
8863   if ((int const   )t == 1) {   8944   if ((int const   )t == 1) {
8864     tmp = 1;   8945     tmp = 1;
8865   } else {   8946   } else {
8866     tmp = 0;   8947     tmp = 0;
8867   }   8948   }
8868   tmp___0 = __builtin_expect((long )tmp, 1L);   8949   tmp___0 = __builtin_expect((long )tmp, 1L);
8869   if (tmp___0) {   8950   if (tmp___0) {
8870     8951  
8871   } else {   8952   } else {
8872     vgPlain_assert_fail((Bool )0, (Char const   *)"t == False || t == True",   8953     vgPlain_assert_fail((Bool )0, (Char const   *)"t == False || t == True",
8873                         (Char const   *)"drd_thread.c", 102,   8954                         (Char const   *)"drd_thread.c", 102,
8874                         (Char const   *)"vgDrd_thread_trace_conflict_set_bm", "");   8955                         (Char const   *)"vgDrd_thread_trace_conflict_set_bm", "");
8875   }   8956   }
8876   s_trace_conflict_set_bm = (Bool )t;   8957   s_trace_conflict_set_bm = (Bool )t;
8877   return;   8958   return;
8878 }   8959 }
8879 }   8960 }
8880 Bool vgDrd_thread_get_trace_fork_join(void)   8961 Bool vgDrd_thread_get_trace_fork_join(void)
8881 {   8962 {
8882     8963  
8883     8964  
8884   {   8965   {
8885   return (s_trace_fork_join);   8966   return (s_trace_fork_join);
8886 }   8967 }
8887 }   8968 }
8888 void vgDrd_thread_set_trace_fork_join(Bool const   t )   8969 void vgDrd_thread_set_trace_fork_join(Bool const   t )
8889 {   8970 {
8890   int tmp ;   8971   int tmp ;
8891   long tmp___0 ;   8972   long tmp___0 ;
8892     8973  
8893   {   8974   {
8894   if ((int const   )t == 0) {   8975   if ((int const   )t == 0) {
8895     tmp = 1;   8976     tmp = 1;
8896   } else   8977   } else
8897   if ((int const   )t == 1) {   8978   if ((int const   )t == 1) {
8898     tmp = 1;   8979     tmp = 1;
8899   } else {   8980   } else {
8900     tmp = 0;   8981     tmp = 0;
8901   }   8982   }
8902   tmp___0 = __builtin_expect((long )tmp, 1L);   8983   tmp___0 = __builtin_expect((long )tmp, 1L);
8903   if (tmp___0) {   8984   if (tmp___0) {
8904     8985  
8905   } else {   8986   } else {
8906     vgPlain_assert_fail((Bool )0, (Char const   *)"t == False || t == True",   8987     vgPlain_assert_fail((Bool )0, (Char const   *)"t == False || t == True",
8907                         (Char const   *)"drd_thread.c", 115,   8988                         (Char const   *)"drd_thread.c", 115,
8908                         (Char const   *)"vgDrd_thread_set_trace_fork_join", "");   8989                         (Char const   *)"vgDrd_thread_set_trace_fork_join", "");
8909   }   8990   }
8910   s_trace_fork_join = (Bool )t;   8991   s_trace_fork_join = (Bool )t;
8911   return;   8992   return;
8912 }   8993 }
8913 }   8994 }
8914 void vgDrd_thread_set_segment_merging(Bool const   m )   8995 void vgDrd_thread_set_segment_merging(Bool const   m )
8915 {   8996 {
8916   int tmp ;   8997   int tmp ;
8917   long tmp___0 ;   8998   long tmp___0 ;
8918     8999  
8919   {   9000   {
8920   if ((int const   )m == 0) {   9001   if ((int const   )m == 0) {
8921     tmp = 1;   9002     tmp = 1;
8922   } else   9003   } else
8923   if ((int const   )m == 1) {   9004   if ((int const   )m == 1) {
8924     tmp = 1;   9005     tmp = 1;
8925   } else {   9006   } else {
8926     tmp = 0;   9007     tmp = 0;
8927   }   9008   }
8928   tmp___0 = __builtin_expect((long )tmp, 1L);   9009   tmp___0 = __builtin_expect((long )tmp, 1L);
8929   if (tmp___0) {   9010   if (tmp___0) {
8930     9011  
8931   } else {   9012   } else {
8932     vgPlain_assert_fail((Bool )0, (Char const   *)"m == False || m == True",   9013     vgPlain_assert_fail((Bool )0, (Char const   *)"m == False || m == True",
8933                         (Char const   *)"drd_thread.c", 122,   9014                         (Char const   *)"drd_thread.c", 122,
8934                         (Char const   *)"vgDrd_thread_set_segment_merging", "");   9015                         (Char const   *)"vgDrd_thread_set_segment_merging", "");
8935   }   9016   }
8936   s_segment_merging = (Bool )m;   9017   s_segment_merging = (Bool )m;
8937   return;   9018   return;
8938 }   9019 }
8939 }   9020 }
8940 int vgDrd_thread_get_segment_merge_interval(void)   9021 int vgDrd_thread_get_segment_merge_interval(void)
8941 {   9022 {
8942     9023  
8943     9024  
8944   {   9025   {
8945   return (s_segment_merge_interval);   9026   return (s_segment_merge_interval);
8946 }   9027 }
8947 }   9028 }
8948 void vgDrd_thread_set_segment_merge_interval(int const   i )   9029 void vgDrd_thread_set_segment_merge_interval(int const   i )
8949 {   9030 {
8950     9031  
8951     9032  
8952   {   9033   {
8953   s_segment_merge_interval = (int )i;   9034   s_segment_merge_interval = (int )i;
8954   return;   9035   return;
8955 }   9036 }
8956 }   9037 }
8957 void vgDrd_thread_set_join_list_vol(int const   jlv )   9038 void vgDrd_thread_set_join_list_vol(int const   jlv )
8958 {   9039 {
8959     9040  
8960     9041  
8961   {   9042   {
8962   s_join_list_vol = (unsigned int )jlv;   9043   s_join_list_vol = (unsigned int )jlv;
8963   return;   9044   return;
8964 }   9045 }
8965 }   9046 }
8966 void vgDrd_thread_init(void)   9047 void vgDrd_thread_init(void)
8967 {   9048 {
8968     9049  
8969     9050  
8970   {   9051   {
8971   return;   9052   return;
8972 }   9053 }
8973 }   9054 }
8974 DrdThreadId vgDrd_VgThreadIdToDrdThreadId(ThreadId const   tid )   9055 DrdThreadId vgDrd_VgThreadIdToDrdThreadId(ThreadId const   tid )
8975 {   9056 {
8976   int i ;   9057   int i ;
8977     9058  
8978   {   9059   {
8979   if (tid == 0U) {   9060   if (tid == 0U) {
8980     return ((DrdThreadId )0);   9061     return ((DrdThreadId )0);
8981   } else {   9062   } else {
8982     9063  
8983   }   9064   }
8984   i = 1;   9065   i = 1;
8985   while (i < 500) {   9066   while (i < 500) {
8986     if ((int )vgDrd_g_threadinfo[i].vg_thread_exists == 1) {   9067     if ((int )vgDrd_g_threadinfo[i].vg_thread_exists == 1) {
8987       if (vgDrd_g_threadinfo[i].vg_threadid == (ThreadId )tid) {   9068       if (vgDrd_g_threadinfo[i].vg_threadid == (ThreadId )tid) {
8988         return ((DrdThreadId )i);   9069         return ((DrdThreadId )i);
8989       } else {   9070       } else {
8990     9071  
8991       }   9072       }
8992     } else {   9073     } else {
8993     9074  
8994     }   9075     }
8995     i ++;   9076     i ++;
8996   }   9077   }
8997   return ((DrdThreadId )0);   9078   return ((DrdThreadId )0);
8998 }   9079 }
8999 }   9080 }
9000 static DrdThreadId vgDrd_VgThreadIdToNewDrdThreadId(ThreadId const   tid )   9081 static DrdThreadId vgDrd_VgThreadIdToNewDrdThreadId(ThreadId const   tid )
9001 {   9082 {
9002   int i ;   9083   int i ;
9003   DrdThreadId tmp ;   9084   DrdThreadId tmp ;
9004   int tmp___0 ;   9085   int tmp___0 ;
9005   long tmp___1 ;   9086   long tmp___1 ;
9006   Bool tmp___2 ;   9087   Bool tmp___2 ;
9007   int tmp___3 ;   9088   int tmp___3 ;
9008   long tmp___4 ;   9089   long tmp___4 ;
9009   long tmp___5 ;   9090   long tmp___5 ;
9010   long tmp___6 ;   9091   long tmp___6 ;
9011   Bool tmp___7 ;   9092   Bool tmp___7 ;
9012   int tmp___8 ;   9093   int tmp___8 ;
9013   long tmp___9 ;   9094   long tmp___9 ;
9014   long tmp___10 ;   9095   long tmp___10 ;
9015     9096  
9016   {   9097   {
9017   tmp = vgDrd_VgThreadIdToDrdThreadId(tid);   9098   tmp = vgDrd_VgThreadIdToDrdThreadId(tid);
9018   if (tmp == 0U) {   9099   if (tmp == 0U) {
9019     tmp___0 = 1;   9100     tmp___0 = 1;
9020   } else {   9101   } else {
9021     tmp___0 = 0;   9102     tmp___0 = 0;
9022   }   9103   }
9023   tmp___1 = __builtin_expect((long )tmp___0, 1L);   9104   tmp___1 = __builtin_expect((long )tmp___0, 1L);
9024   if (tmp___1) {   9105   if (tmp___1) {
9025     9106  
9026   } else {   9107   } else {
9027     vgPlain_assert_fail((Bool )0,   9108     vgPlain_assert_fail((Bool )0,
9028                         (Char const   *)"DRD_(VgThreadIdToDrdThreadId)(tid) == DRD_INVALID_THREADID",   9109                         (Char const   *)"DRD_(VgThreadIdToDrdThreadId)(tid) == DRD_INVALID_THREADID",
9029                         (Char const   *)"drd_thread.c", 177,   9110                         (Char const   *)"drd_thread.c", 177,
9030                         (Char const   *)"vgDrd_VgThreadIdToNewDrdThreadId", "");   9111                         (Char const   *)"vgDrd_VgThreadIdToNewDrdThreadId", "");
9031   }   9112   }
9032   i = 1;   9113   i = 1;
9033   while (i < 500) {   9114   while (i < 500) {
9034     if (! vgDrd_g_threadinfo[i].valid) {   9115     if (! vgDrd_g_threadinfo[i].valid) {
9035       tmp___2 = vgDrd_IsValidDrdThreadId((DrdThreadId const   )i);   9116       tmp___2 = vgDrd_IsValidDrdThreadId((DrdThreadId const   )i);
9036       if (tmp___2) {   9117       if (tmp___2) {
9037         tmp___3 = 0;   9118         tmp___3 = 0;
9038       } else {   9119       } else {
9039         tmp___3 = 1;   9120         tmp___3 = 1;
9040       }   9121       }
9041       tmp___4 = __builtin_expect((long )tmp___3, 1L);   9122       tmp___4 = __builtin_expect((long )tmp___3, 1L);
9042       if (tmp___4) {   9123       if (tmp___4) {
9043     9124  
9044       } else {   9125       } else {
9045         vgPlain_assert_fail((Bool )0,   9126         vgPlain_assert_fail((Bool )0,
9046                             (Char const   *)"! DRD_(IsValidDrdThreadId)(i)",   9127                             (Char const   *)"! DRD_(IsValidDrdThreadId)(i)",
9047                             (Char const   *)"drd_thread.c", 183,   9128                             (Char const   *)"drd_thread.c", 183,
9048                             (Char const   *)"vgDrd_VgThreadIdToNewDrdThreadId",   9129                             (Char const   *)"vgDrd_VgThreadIdToNewDrdThreadId",
9049                             "");   9130                             "");
9050       }   9131       }
9051       vgDrd_g_threadinfo[i].valid = (Bool )1;   9132       vgDrd_g_threadinfo[i].valid = (Bool )1;
9052       vgDrd_g_threadinfo[i].vg_thread_exists = (Bool )1;   9133       vgDrd_g_threadinfo[i].vg_thread_exists = (Bool )1;
9053       vgDrd_g_threadinfo[i].vg_threadid = (ThreadId )tid;   9134       vgDrd_g_threadinfo[i].vg_threadid = (ThreadId )tid;
9054       vgDrd_g_threadinfo[i].pt_threadid = (PThreadId )0;   9135       vgDrd_g_threadinfo[i].pt_threadid = (PThreadId )0;
9055       vgDrd_g_threadinfo[i].stack_min = (Addr )0;   9136       vgDrd_g_threadinfo[i].stack_min = (Addr )0;
9056       vgDrd_g_threadinfo[i].stack_min_min = (Addr )0;   9137       vgDrd_g_threadinfo[i].stack_min_min = (Addr )0;
9057       vgDrd_g_threadinfo[i].stack_startup = (Addr )0;   9138       vgDrd_g_threadinfo[i].stack_startup = (Addr )0;
9058       vgDrd_g_threadinfo[i].stack_max = (Addr )0;   9139       vgDrd_g_threadinfo[i].stack_max = (Addr )0;
9059       vgDrd_thread_set_name((DrdThreadId const   )i,   9140       vgDrd_thread_set_name((DrdThreadId const   )i,
9060                             (char const   */* const  */)"");   9141                             (char const   */* const  */)"");
9061       vgDrd_g_threadinfo[i].on_alt_stack = (Bool )0;   9142       vgDrd_g_threadinfo[i].on_alt_stack = (Bool )0;
9062       vgDrd_g_threadinfo[i].is_recording_loads = (Bool )1;   9143       vgDrd_g_threadinfo[i].is_recording_loads = (Bool )1;
9063       vgDrd_g_threadinfo[i].is_recording_stores = (Bool )1;   9144       vgDrd_g_threadinfo[i].is_recording_stores = (Bool )1;
9064       vgDrd_g_threadinfo[i].pthread_create_nesting_level = 0;   9145       vgDrd_g_threadinfo[i].pthread_create_nesting_level = 0;
9065       vgDrd_g_threadinfo[i].synchr_nesting = 0;   9146       vgDrd_g_threadinfo[i].synchr_nesting = 0;
9066       vgDrd_g_threadinfo[i].deletion_seq = s_deletion_tail - 1U;   9147       vgDrd_g_threadinfo[i].deletion_seq = s_deletion_tail - 1U;
9067       tmp___5 = __builtin_expect((long )(! (! ((unsigned int )vgDrd_g_threadinfo[i].sg_first == (unsigned int )((void *)0)))),   9148       tmp___5 = __builtin_expect((long )(! (! ((unsigned int )vgDrd_g_threadinfo[i].sg_first == (unsigned int )((void *)0)))),
9068                                  1L);   9149                                  1L);
9069       if (tmp___5) {   9150       if (tmp___5) {
9070     9151  
9071       } else {   9152       } else {
9072         vgPlain_assert_fail((Bool )0,   9153         vgPlain_assert_fail((Bool )0,
9073                             (Char const   *)"DRD_(g_threadinfo)[i].sg_first == NULL",   9154                             (Char const   *)"DRD_(g_threadinfo)[i].sg_first == NULL",
9074                             (Char const   *)"drd_thread.c", 200,   9155                             (Char const   *)"drd_thread.c", 200,
9075                             (Char const   *)"vgDrd_VgThreadIdToNewDrdThreadId",   9156                             (Char const   *)"vgDrd_VgThreadIdToNewDrdThreadId",
9076                             "");   9157                             "");
9077       }   9158       }
9078       tmp___6 = __builtin_expect((long )(! (! ((unsigned int )vgDrd_g_threadinfo[i].sg_last == (unsigned int )((void *)0)))),   9159       tmp___6 = __builtin_expect((long )(! (! ((unsigned int )vgDrd_g_threadinfo[i].sg_last == (unsigned int )((void *)0)))),
9079                                  1L);   9160                                  1L);
9080       if (tmp___6) {   9161       if (tmp___6) {
9081     9162  
9082       } else {   9163       } else {
9083         vgPlain_assert_fail((Bool )0,   9164         vgPlain_assert_fail((Bool )0,
9084                             (Char const   *)"DRD_(g_threadinfo)[i].sg_last == NULL",   9165                             (Char const   *)"DRD_(g_threadinfo)[i].sg_last == NULL",
9085                             (Char const   *)"drd_thread.c", 201,   9166                             (Char const   *)"drd_thread.c", 201,
9086                             (Char const   *)"vgDrd_VgThreadIdToNewDrdThreadId",   9167                             (Char const   *)"vgDrd_VgThreadIdToNewDrdThreadId",
9087                             "");   9168                             "");
9088       }   9169       }
9089       tmp___7 = vgDrd_IsValidDrdThreadId((DrdThreadId const   )i);   9170       tmp___7 = vgDrd_IsValidDrdThreadId((DrdThreadId const   )i);
9090       if (tmp___7) {   9171       if (tmp___7) {
9091         tmp___8 = 1;   9172         tmp___8 = 1;
9092       } else {   9173       } else {
9093         tmp___8 = 0;   9174         tmp___8 = 0;
9094       }   9175       }
9095       tmp___9 = __builtin_expect((long )tmp___8, 1L);   9176       tmp___9 = __builtin_expect((long )tmp___8, 1L);
9096       if (tmp___9) {   9177       if (tmp___9) {
9097     9178  
9098       } else {   9179       } else {
9099         vgPlain_assert_fail((Bool )0,   9180         vgPlain_assert_fail((Bool )0,
9100                             (Char const   *)"DRD_(IsValidDrdThreadId)(i)",   9181                             (Char const   *)"DRD_(IsValidDrdThreadId)(i)",
9101                             (Char const   *)"drd_thread.c", 203,   9182                             (Char const   *)"drd_thread.c", 203,
9102                             (Char const   *)"vgDrd_VgThreadIdToNewDrdThreadId",   9183                             (Char const   *)"vgDrd_VgThreadIdToNewDrdThreadId",
9103                             "");   9184                             "");
9104       }   9185       }
9105       return ((DrdThreadId )i);   9186       return ((DrdThreadId )i);
9106     } else {   9187     } else {
9107     9188  
9108     }   9189     }
9109     i ++;   9190     i ++;
9110   }   9191   }
9111   vgPlain_printf("\nSorry, but the maximum number of threads supported by DRD has been exceeded.Aborting.\n");   9192   vgPlain_printf("\nSorry, but the maximum number of threads supported by DRD has been exceeded.Aborting.\n");
9112   tmp___10 = __builtin_expect(0L, 1L);   9193   tmp___10 = __builtin_expect(0L, 1L);
9113   if (tmp___10) {   9194   if (tmp___10) {
9114     9195  
9115   } else {   9196   } else {
9116     vgPlain_assert_fail((Bool )0, (Char const   *)"False",   9197     vgPlain_assert_fail((Bool )0, (Char const   *)"False",
9117                         (Char const   *)"drd_thread.c", 213,   9198                         (Char const   *)"drd_thread.c", 213,
9118                         (Char const   *)"vgDrd_VgThreadIdToNewDrdThreadId", "");   9199                         (Char const   *)"vgDrd_VgThreadIdToNewDrdThreadId", "");
9119   }   9200   }
9120   return ((DrdThreadId )0);   9201   return ((DrdThreadId )0);
9121 }   9202 }
9122 }   9203 }
9123 DrdThreadId vgDrd_PtThreadIdToDrdThreadId(PThreadId const   tid )   9204 DrdThreadId vgDrd_PtThreadIdToDrdThreadId(PThreadId const   tid )
9124 {   9205 {
9125   int i ;   9206   int i ;
9126     9207  
9127   {   9208   {
9128   if (tid != 0UL) {   9209   if (tid != 0UL) {
9129     i = 1;   9210     i = 1;
9130     while (i < 500) {   9211     while (i < 500) {
9131       if (vgDrd_g_threadinfo[i].posix_thread_exists) {   9212       if (vgDrd_g_threadinfo[i].posix_thread_exists) {
9132         if (vgDrd_g_threadinfo[i].pt_threadid == (PThreadId )tid) {   9213         if (vgDrd_g_threadinfo[i].pt_threadid == (PThreadId )tid) {
9133           return ((DrdThreadId )i);   9214           return ((DrdThreadId )i);
9134         } else {   9215         } else {
9135     9216  
9136         }   9217         }
9137       } else {   9218       } else {
9138     9219  
9139       }   9220       }
9140       i ++;   9221       i ++;
9141     }   9222     }
9142   } else {   9223   } else {
9143     9224  
9144   }   9225   }
9145   return ((DrdThreadId )0);   9226   return ((DrdThreadId )0);
9146 }   9227 }
9147 }   9228 }
9148 ThreadId vgDrd_DrdThreadIdToVgThreadId(DrdThreadId const   tid )   9229 ThreadId vgDrd_DrdThreadIdToVgThreadId(DrdThreadId const   tid )
9149 {   9230 {
9150   int tmp ;   9231   int tmp ;
9151   long tmp___0 ;   9232   long tmp___0 ;
9152   ThreadId tmp___1 ;   9233   ThreadId tmp___1 ;
9153     9234  
9154   {   9235   {
9155   if (0 <= (int )tid) {   9236   if (0 <= (int )tid) {
9156     if (tid < 500U) {   9237     if (tid < 500U) {
9157       if (tid != 0U) {   9238       if (tid != 0U) {
9158         tmp = 1;   9239         tmp = 1;
9159       } else {   9240       } else {
9160         tmp = 0;   9241         tmp = 0;
9161       }   9242       }
9162     } else {   9243     } else {
9163       tmp = 0;   9244       tmp = 0;
9164     }   9245     }
9165   } else {   9246   } else {
9166     tmp = 0;   9247     tmp = 0;
9167   }   9248   }
9168   tmp___0 = __builtin_expect((long )tmp, 1L);   9249   tmp___0 = __builtin_expect((long )tmp, 1L);
9169   if (tmp___0) {   9250   if (tmp___0) {
9170     9251  
9171   } else {   9252   } else {
9172     vgPlain_assert_fail((Bool )0,   9253     vgPlain_assert_fail((Bool )0,
9173                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   9254                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
9174                         (Char const   *)"drd_thread.c", 241,   9255                         (Char const   *)"drd_thread.c", 241,
9175                         (Char const   *)"vgDrd_DrdThreadIdToVgThreadId", "");   9256                         (Char const   *)"vgDrd_DrdThreadIdToVgThreadId", "");
9176   }   9257   }
9177   if (vgDrd_g_threadinfo[tid].vg_thread_exists) {   9258   if (vgDrd_g_threadinfo[tid].vg_thread_exists) {
9178     tmp___1 = vgDrd_g_threadinfo[tid].vg_threadid;   9259     tmp___1 = vgDrd_g_threadinfo[tid].vg_threadid;
9179   } else {   9260   } else {
9180     tmp___1 = (ThreadId )0;   9261     tmp___1 = (ThreadId )0;
9181   }   9262   }
9182   return (tmp___1);   9263   return (tmp___1);
9183 }   9264 }
9184 }   9265 }
9185 DrdThreadId vgDrd_thread_pre_create(DrdThreadId const   creator ,   9266 DrdThreadId vgDrd_thread_pre_create(DrdThreadId const   creator ,
9186                                     ThreadId const   vg_created )   9267                                     ThreadId const   vg_created )
9187 {   9268 {
9188   DrdThreadId created ;   9269   DrdThreadId created ;
9189   DrdThreadId tmp ;   9270   DrdThreadId tmp ;
9190   int tmp___0 ;   9271   int tmp___0 ;
9191   long tmp___1 ;   9272   long tmp___1 ;
9192   int tmp___2 ;   9273   int tmp___2 ;
9193   long tmp___3 ;   9274   long tmp___3 ;
9194   long tmp___4 ;   9275   long tmp___4 ;
9195   long tmp___5 ;   9276   long tmp___5 ;
9196   Segment *tmp___6 ;   9277   Segment *tmp___6 ;
9197     9278  
9198   {   9279   {
9199   tmp = vgDrd_VgThreadIdToDrdThreadId(vg_created);   9280   tmp = vgDrd_VgThreadIdToDrdThreadId(vg_created);
9200   if (tmp == 0U) {   9281   if (tmp == 0U) {
9201     tmp___0 = 1;   9282     tmp___0 = 1;
9202   } else {   9283   } else {
9203     tmp___0 = 0;   9284     tmp___0 = 0;
9204   }   9285   }
9205   tmp___1 = __builtin_expect((long )tmp___0, 1L);   9286   tmp___1 = __builtin_expect((long )tmp___0, 1L);
9206   if (tmp___1) {   9287   if (tmp___1) {
9207     9288  
9208   } else {   9289   } else {
9209     vgPlain_assert_fail((Bool )0,   9290     vgPlain_assert_fail((Bool )0,
9210                         (Char const   *)"DRD_(VgThreadIdToDrdThreadId)(vg_created) == DRD_INVALID_THREADID",   9291                         (Char const   *)"DRD_(VgThreadIdToDrdThreadId)(vg_created) == DRD_INVALID_THREADID",
9211                         (Char const   *)"drd_thread.c", 292,   9292                         (Char const   *)"drd_thread.c", 292,
9212                         (Char const   *)"vgDrd_thread_pre_create", "");   9293                         (Char const   *)"vgDrd_thread_pre_create", "");
9213   }   9294   }
9214   created = vgDrd_VgThreadIdToNewDrdThreadId(vg_created);   9295   created = vgDrd_VgThreadIdToNewDrdThreadId(vg_created);
9215   if (0 <= (int )created) {   9296   if (0 <= (int )created) {
9216     if (created < 500U) {   9297     if (created < 500U) {
9217       if (created != 0U) {   9298       if (created != 0U) {
9218         tmp___2 = 1;   9299         tmp___2 = 1;
9219       } else {   9300       } else {
9220         tmp___2 = 0;   9301         tmp___2 = 0;
9221       }   9302       }
9222     } else {   9303     } else {
9223       tmp___2 = 0;   9304       tmp___2 = 0;
9224     }   9305     }
9225   } else {   9306   } else {
9226     tmp___2 = 0;   9307     tmp___2 = 0;
9227   }   9308   }
9228   tmp___3 = __builtin_expect((long )tmp___2, 1L);   9309   tmp___3 = __builtin_expect((long )tmp___2, 1L);
9229   if (tmp___3) {   9310   if (tmp___3) {
9230     9311  
9231   } else {   9312   } else {
9232     vgPlain_assert_fail((Bool )0,   9313     vgPlain_assert_fail((Bool )0,
9233                         (Char const   *)"0 <= (int)created && created < DRD_N_THREADS && created != DRD_INVALID_THREADID",   9314                         (Char const   *)"0 <= (int)created && created < DRD_N_THREADS && created != DRD_INVALID_THREADID",
9234                         (Char const   *)"drd_thread.c", 295,   9315                         (Char const   *)"drd_thread.c", 295,
9235                         (Char const   *)"vgDrd_thread_pre_create", "");   9316                         (Char const   *)"vgDrd_thread_pre_create", "");
9236   }   9317   }
9237   tmp___4 = __builtin_expect((long )(! (! ((unsigned int )vgDrd_g_threadinfo[created].sg_first == (unsigned int )((void *)0)))),   9318   tmp___4 = __builtin_expect((long )(! (! ((unsigned int )vgDrd_g_threadinfo[created].sg_first == (unsigned int )((void *)0)))),
9238                              1L);   9319                              1L);
9239   if (tmp___4) {   9320   if (tmp___4) {
9240     9321  
9241   } else {   9322   } else {
9242     vgPlain_assert_fail((Bool )0,   9323     vgPlain_assert_fail((Bool )0,
9243                         (Char const   *)"DRD_(g_threadinfo)[created].sg_first == NULL",   9324                         (Char const   *)"DRD_(g_threadinfo)[created].sg_first == NULL",
9244                         (Char const   *)"drd_thread.c", 297,   9325                         (Char const   *)"drd_thread.c", 297,
9245                         (Char const   *)"vgDrd_thread_pre_create", "");   9326                         (Char const   *)"vgDrd_thread_pre_create", "");
9246   }   9327   }
9247   tmp___5 = __builtin_expect((long )(! (! ((unsigned int )vgDrd_g_threadinfo[created].sg_last == (unsigned int )((void *)0)))),   9328   tmp___5 = __builtin_expect((long )(! (! ((unsigned int )vgDrd_g_threadinfo[created].sg_last == (unsigned int )((void *)0)))),
9248                              1L);   9329                              1L);
9249   if (tmp___5) {   9330   if (tmp___5) {
9250     9331  
9251   } else {   9332   } else {
9252     vgPlain_assert_fail((Bool )0,   9333     vgPlain_assert_fail((Bool )0,
9253                         (Char const   *)"DRD_(g_threadinfo)[created].sg_last == NULL",   9334                         (Char const   *)"DRD_(g_threadinfo)[created].sg_last == NULL",
9254                         (Char const   *)"drd_thread.c", 298,   9335                         (Char const   *)"drd_thread.c", 298,
9255                         (Char const   *)"vgDrd_thread_pre_create", "");   9336                         (Char const   *)"vgDrd_thread_pre_create", "");
9256   }   9337   }
9257   tmp___6 = vgDrd_sg_new(creator, (DrdThreadId const   )created);   9338   tmp___6 = vgDrd_sg_new(creator, (DrdThreadId const   )created);
9258   thread_append_segment((DrdThreadId const   )created,   9339   thread_append_segment((DrdThreadId const   )created,
9259                         (Segment */* const  */)tmp___6);   9340                         (Segment */* const  */)tmp___6);
9260   return (created);   9341   return (created);
9261 }   9342 }
9262 }   9343 }
9263 DrdThreadId vgDrd_thread_post_create(ThreadId const   vg_created )   9344 DrdThreadId vgDrd_thread_post_create(ThreadId const   vg_created )
9264 {   9345 {
9265   DrdThreadId created ;   9346   DrdThreadId created ;
9266   DrdThreadId tmp ;   9347   DrdThreadId tmp ;
9267   int tmp___0 ;   9348   int tmp___0 ;
9268   long tmp___1 ;   9349   long tmp___1 ;
9269   long tmp___2 ;   9350   long tmp___2 ;
9270     9351  
9271   {   9352   {
9272   tmp = vgDrd_VgThreadIdToDrdThreadId(vg_created);   9353   tmp = vgDrd_VgThreadIdToDrdThreadId(vg_created);
9273   created = tmp;   9354   created = tmp;
9274   if (0 <= (int )created) {   9355   if (0 <= (int )created) {
9275     if (created < 500U) {   9356     if (created < 500U) {
9276       if (created != 0U) {   9357       if (created != 0U) {
9277         tmp___0 = 1;   9358         tmp___0 = 1;
9278       } else {   9359       } else {
9279         tmp___0 = 0;   9360         tmp___0 = 0;
9280       }   9361       }
9281     } else {   9362     } else {
9282       tmp___0 = 0;   9363       tmp___0 = 0;
9283     }   9364     }
9284   } else {   9365   } else {
9285     tmp___0 = 0;   9366     tmp___0 = 0;
9286   }   9367   }
9287   tmp___1 = __builtin_expect((long )tmp___0, 1L);   9368   tmp___1 = __builtin_expect((long )tmp___0, 1L);
9288   if (tmp___1) {   9369   if (tmp___1) {
9289     9370  
9290   } else {   9371   } else {
9291     vgPlain_assert_fail((Bool )0,   9372     vgPlain_assert_fail((Bool )0,
9292                         (Char const   *)"0 <= (int)created && created < DRD_N_THREADS && created != DRD_INVALID_THREADID",   9373                         (Char const   *)"0 <= (int)created && created < DRD_N_THREADS && created != DRD_INVALID_THREADID",
9293                         (Char const   *)"drd_thread.c", 320,   9374                         (Char const   *)"drd_thread.c", 320,
9294                         (Char const   *)"vgDrd_thread_post_create", "");   9375                         (Char const   *)"vgDrd_thread_post_create", "");
9295   }   9376   }
9296   vgDrd_g_threadinfo[created].stack_max = vgPlain_thread_get_stack_max((ThreadId )vg_created);   9377   vgDrd_g_threadinfo[created].stack_max = vgPlain_thread_get_stack_max((ThreadId )vg_created);
9297   vgDrd_g_threadinfo[created].stack_startup = vgDrd_g_threadinfo[created].stack_max;   9378   vgDrd_g_threadinfo[created].stack_startup = vgDrd_g_threadinfo[created].stack_max;
9298   vgDrd_g_threadinfo[created].stack_min = vgDrd_g_threadinfo[created].stack_max;   9379   vgDrd_g_threadinfo[created].stack_min = vgDrd_g_threadinfo[created].stack_max;
9299   vgDrd_g_threadinfo[created].stack_min_min = vgDrd_g_threadinfo[created].stack_max;   9380   vgDrd_g_threadinfo[created].stack_min_min = vgDrd_g_threadinfo[created].stack_max;
9300   vgDrd_g_threadinfo[created].stack_size = vgPlain_thread_get_stack_size((ThreadId )vg_created);   9381   vgDrd_g_threadinfo[created].stack_size = vgPlain_thread_get_stack_size((ThreadId )vg_created);
9301   tmp___2 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[created].stack_max != 0UL))),   9382   tmp___2 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[created].stack_max != 0UL))),
9302                              1L);   9383                              1L);
9303   if (tmp___2) {   9384   if (tmp___2) {
9304     9385  
9305   } else {   9386   } else {
9306     vgPlain_assert_fail((Bool )0,   9387     vgPlain_assert_fail((Bool )0,
9307                         (Char const   *)"DRD_(g_threadinfo)[created].stack_max != 0",   9388                         (Char const   *)"DRD_(g_threadinfo)[created].stack_max != 0",
9308                         (Char const   *)"drd_thread.c", 332,   9389                         (Char const   *)"drd_thread.c", 332,
9309                         (Char const   *)"vgDrd_thread_post_create", "");   9390                         (Char const   *)"vgDrd_thread_post_create", "");
9310   }   9391   }
9311   return (created);   9392   return (created);
9312 }   9393 }
9313 }   9394 }
9314 static void vgDrd_thread_delayed_delete(DrdThreadId const   tid )   9395 static void vgDrd_thread_delayed_delete(DrdThreadId const   tid )
9315 {   9396 {
9316   int j ;   9397   int j ;
9317   unsigned int tmp ;   9398   unsigned int tmp ;
9318   Bool tmp___0 ;   9399   Bool tmp___0 ;
9319     9400  
9320   {   9401   {
9321   vgDrd_g_threadinfo[tid].vg_thread_exists = (Bool )0;   9402   vgDrd_g_threadinfo[tid].vg_thread_exists = (Bool )0;
9322   vgDrd_g_threadinfo[tid].posix_thread_exists = (Bool )0;   9403   vgDrd_g_threadinfo[tid].posix_thread_exists = (Bool )0;
9323   tmp = s_deletion_head;   9404   tmp = s_deletion_head;
9324   s_deletion_head ++;   9405   s_deletion_head ++;
9325   vgDrd_g_threadinfo[tid].deletion_seq = tmp;   9406   vgDrd_g_threadinfo[tid].deletion_seq = tmp;
9326   if (s_deletion_head - s_deletion_tail >= s_join_list_vol) {   9407   if (s_deletion_head - s_deletion_tail >= s_join_list_vol) {
9327     j = 0;   9408     j = 0;
9328     while (j < 500) {   9409     while (j < 500) {
9329       tmp___0 = vgDrd_IsValidDrdThreadId((DrdThreadId const   )j);   9410       tmp___0 = vgDrd_IsValidDrdThreadId((DrdThreadId const   )j);
9330       if (tmp___0) {   9411       if (tmp___0) {
9331         if (vgDrd_g_threadinfo[j].deletion_seq == s_deletion_tail) {   9412         if (vgDrd_g_threadinfo[j].deletion_seq == s_deletion_tail) {
9332           s_deletion_tail ++;   9413           s_deletion_tail ++;
9333           vgDrd_thread_delete((DrdThreadId const   )j, (Bool )0);   9414           vgDrd_thread_delete((DrdThreadId const   )j, (Bool )0);
9334           break;   9415           break;
9335         } else {   9416         } else {
9336     9417  
9337         }   9418         }
9338       } else {   9419       } else {
9339     9420  
9340       }   9421       }
9341       j ++;   9422       j ++;
9342     }   9423     }
9343   } else {   9424   } else {
9344     9425  
9345   }   9426   }
9346   return;   9427   return;
9347 }   9428 }
9348 }   9429 }
9349 void vgDrd_thread_post_join(DrdThreadId drd_joiner , DrdThreadId drd_joinee )   9430 void vgDrd_thread_post_join(DrdThreadId drd_joiner , DrdThreadId drd_joinee )
9350 {   9431 {
9351   Bool tmp ;   9432   Bool tmp ;
9352   int tmp___0 ;   9433   int tmp___0 ;
9353   long tmp___1 ;   9434   long tmp___1 ;
9354   Bool tmp___2 ;   9435   Bool tmp___2 ;
9355   int tmp___3 ;   9436   int tmp___3 ;
9356   long tmp___4 ;   9437   long tmp___4 ;
9357   ThreadId joiner ;   9438   ThreadId joiner ;
9358   ThreadId tmp___5 ;   9439   ThreadId tmp___5 ;
9359   unsigned int msg_size ;   9440   unsigned int msg_size ;
9360   char *msg ;   9441   char *msg ;
9361   void *tmp___6 ;   9442   void *tmp___6 ;
9362   long tmp___7 ;   9443   long tmp___7 ;
9363   char *vc ;   9444   char *vc ;
9364   VectorClock *tmp___8 ;   9445   VectorClock *tmp___8 ;
9365   SizeT tmp___9 ;   9446   SizeT tmp___9 ;
9366   SizeT tmp___10 ;   9447   SizeT tmp___10 ;
9367   Addr tmp___11 ;   9448   Addr tmp___11 ;
9368   Addr tmp___12 ;   9449   Addr tmp___12 ;
9369   SizeT tmp___13 ;   9450   SizeT tmp___13 ;
9370   Bool tmp___14 ;   9451   Bool tmp___14 ;
9371     9452  
9372   {   9453   {
9373   tmp = vgDrd_IsValidDrdThreadId((DrdThreadId const   )drd_joiner);   9454   tmp = vgDrd_IsValidDrdThreadId((DrdThreadId const   )drd_joiner);
9374   if (tmp) {   9455   if (tmp) {
9375     tmp___0 = 1;   9456     tmp___0 = 1;
9376   } else {   9457   } else {
9377     tmp___0 = 0;   9458     tmp___0 = 0;
9378   }   9459   }
9379   tmp___1 = __builtin_expect((long )tmp___0, 1L);   9460   tmp___1 = __builtin_expect((long )tmp___0, 1L);
9380   if (tmp___1) {   9461   if (tmp___1) {
9381     9462  
9382   } else {   9463   } else {
9383     vgPlain_assert_fail((Bool )0,   9464     vgPlain_assert_fail((Bool )0,
9384                         (Char const   *)"DRD_(IsValidDrdThreadId)(drd_joiner)",   9465                         (Char const   *)"DRD_(IsValidDrdThreadId)(drd_joiner)",
9385                         (Char const   *)"drd_thread.c", 369,   9466                         (Char const   *)"drd_thread.c", 369,
9386                         (Char const   *)"vgDrd_thread_post_join", "");   9467                         (Char const   *)"vgDrd_thread_post_join", "");
9387   }   9468   }
9388   tmp___2 = vgDrd_IsValidDrdThreadId((DrdThreadId const   )drd_joinee);   9469   tmp___2 = vgDrd_IsValidDrdThreadId((DrdThreadId const   )drd_joinee);
9389   if (tmp___2) {   9470   if (tmp___2) {
9390     tmp___3 = 1;   9471     tmp___3 = 1;
9391   } else {   9472   } else {
9392     tmp___3 = 0;   9473     tmp___3 = 0;
9393   }   9474   }
9394   tmp___4 = __builtin_expect((long )tmp___3, 1L);   9475   tmp___4 = __builtin_expect((long )tmp___3, 1L);
9395   if (tmp___4) {   9476   if (tmp___4) {
9396     9477  
9397   } else {   9478   } else {
9398     vgPlain_assert_fail((Bool )0,   9479     vgPlain_assert_fail((Bool )0,
9399                         (Char const   *)"DRD_(IsValidDrdThreadId)(drd_joinee)",   9480                         (Char const   *)"DRD_(IsValidDrdThreadId)(drd_joinee)",
9400                         (Char const   *)"drd_thread.c", 370,   9481                         (Char const   *)"drd_thread.c", 370,
9401                         (Char const   *)"vgDrd_thread_post_join", "");   9482                         (Char const   *)"vgDrd_thread_post_join", "");
9402   }   9483   }
9403   vgDrd_thread_new_segment((DrdThreadId const   )drd_joiner);   9484   vgDrd_thread_new_segment((DrdThreadId const   )drd_joiner);
9404   vgDrd_thread_combine_vc_join((DrdThreadId const   )drd_joiner,   9485   vgDrd_thread_combine_vc_join((DrdThreadId const   )drd_joiner,
9405                                (DrdThreadId const   )drd_joinee);   9486                                (DrdThreadId const   )drd_joinee);
9406   vgDrd_thread_new_segment((DrdThreadId const   )drd_joinee);   9487   vgDrd_thread_new_segment((DrdThreadId const   )drd_joinee);
9407   if (s_trace_fork_join) {   9488   if (s_trace_fork_join) {
9408     tmp___5 = vgDrd_DrdThreadIdToVgThreadId((DrdThreadId const   )drd_joiner);   9489     tmp___5 = vgDrd_DrdThreadIdToVgThreadId((DrdThreadId const   )drd_joiner);
9409     joiner = tmp___5;   9490     joiner = tmp___5;
9410     msg_size = 256U;   9491     msg_size = 256U;
9411     tmp___6 = vgPlain_malloc((HChar *)"drd.main.dptj.1", (SizeT )msg_size);   9492     tmp___6 = vgPlain_malloc((HChar *)"drd.main.dptj.1", (SizeT )msg_size);
9412     msg = (char *)tmp___6;   9493     msg = (char *)tmp___6;
9413     tmp___7 = __builtin_expect((long )(! (! msg)), 1L);   9494     tmp___7 = __builtin_expect((long )(! (! msg)), 1L);
9414     if (tmp___7) {   9495     if (tmp___7) {
9415     9496  
9416     } else {   9497     } else {
9417       vgPlain_assert_fail((Bool )0, (Char const   *)"msg",   9498       vgPlain_assert_fail((Bool )0, (Char const   *)"msg",
9418                           (Char const   *)"drd_thread.c", 383,   9499                           (Char const   *)"drd_thread.c", 383,
9419                           (Char const   *)"vgDrd_thread_post_join", "");   9500                           (Char const   *)"vgDrd_thread_post_join", "");
9420     }   9501     }
9421     vgPlain_snprintf((Char *)msg, (Int )msg_size,   9502     vgPlain_snprintf((Char *)msg, (Int )msg_size,
9422                      "drd_post_thread_join joiner = %d, joinee = %d",   9503                      "drd_post_thread_join joiner = %d, joinee = %d",
9423                      drd_joiner, drd_joinee);   9504                      drd_joiner, drd_joinee);
9424     if (joiner) {   9505     if (joiner) {
9425       tmp___8 = vgDrd_thread_get_vc((DrdThreadId const   )drd_joiner);   9506       tmp___8 = vgDrd_thread_get_vc((DrdThreadId const   )drd_joiner);
9426       vc = vgDrd_vc_aprint((VectorClock const   */* const  */)tmp___8);   9507       vc = vgDrd_vc_aprint((VectorClock const   */* const  */)tmp___8);
9427       tmp___9 = vgPlain_strlen((Char const   *)msg);   9508       tmp___9 = vgPlain_strlen((Char const   *)msg);
9428       tmp___10 = vgPlain_strlen((Char const   *)msg);   9509       tmp___10 = vgPlain_strlen((Char const   *)msg);
9429       vgPlain_snprintf((Char *)(msg + tmp___10),   9510       vgPlain_snprintf((Char *)(msg + tmp___10),
9430                        (Int )((SizeT )msg_size - tmp___9), ", new vc: %s", vc);   9511                        (Int )((SizeT )msg_size - tmp___9), ", new vc: %s", vc);
9431       vgPlain_free((void *)vc);   9512       vgPlain_free((void *)vc);
9432     } else {   9513     } else {
9433     9514  
9434     }   9515     }
9435     vgDrd_trace_msg("%pS", msg);   9516     vgDrd_trace_msg("%pS", msg);
9436     vgPlain_free((void *)msg);   9517     vgPlain_free((void *)msg);
9437   } else {   9518   } else {
9438     9519  
9439   }   9520   }
9440   tmp___14 = vgDrd_get_check_stack_accesses();   9521   tmp___14 = vgDrd_get_check_stack_accesses();
9441   if (tmp___14) {   9522   if (tmp___14) {
9442     9523  
9443   } else {   9524   } else {
9444     tmp___11 = vgDrd_thread_get_stack_max((DrdThreadId const   )drd_joinee);   9525     tmp___11 = vgDrd_thread_get_stack_max((DrdThreadId const   )drd_joinee);
9445     tmp___12 = vgDrd_thread_get_stack_max((DrdThreadId const   )drd_joinee);   9526     tmp___12 = vgDrd_thread_get_stack_max((DrdThreadId const   )drd_joinee);
9446     tmp___13 = vgDrd_thread_get_stack_size((DrdThreadId const   )drd_joinee);   9527     tmp___13 = vgDrd_thread_get_stack_size((DrdThreadId const   )drd_joinee);
9447     vgDrd_finish_suppression((Addr const   )(tmp___12 - tmp___13),   9528     vgDrd_finish_suppression((Addr const   )(tmp___12 - tmp___13),
9448                              (Addr const   )tmp___11);   9529                              (Addr const   )tmp___11);
9449   }   9530   }
9450   vgDrd_clientobj_delete_thread((DrdThreadId const   )drd_joinee);   9531   vgDrd_clientobj_delete_thread((DrdThreadId const   )drd_joinee);
9451   vgDrd_thread_delayed_delete((DrdThreadId const   )drd_joinee);   9532   vgDrd_thread_delayed_delete((DrdThreadId const   )drd_joinee);
9452   return;   9533   return;
9453 }   9534 }
9454 }   9535 }
9455 void vgDrd_thread_set_stack_startup(DrdThreadId const   tid ,   9536 void vgDrd_thread_set_stack_startup(DrdThreadId const   tid ,
9456                                     Addr const   stack_startup )   9537                                     Addr const   stack_startup )
9457 {   9538 {
9458   int tmp ;   9539   int tmp ;
9459   long tmp___0 ;   9540   long tmp___0 ;
9460   long tmp___1 ;   9541   long tmp___1 ;
9461   long tmp___2 ;   9542   long tmp___2 ;
9462     9543  
9463   {   9544   {
9464   if (0 <= (int )tid) {   9545   if (0 <= (int )tid) {
9465     if (tid < 500U) {   9546     if (tid < 500U) {
9466       if (tid != 0U) {   9547       if (tid != 0U) {
9467         tmp = 1;   9548         tmp = 1;
9468       } else {   9549       } else {
9469         tmp = 0;   9550         tmp = 0;
9470       }   9551       }
9471     } else {   9552     } else {
9472       tmp = 0;   9553       tmp = 0;
9473     }   9554     }
9474   } else {   9555   } else {
9475     tmp = 0;   9556     tmp = 0;
9476   }   9557   }
9477   tmp___0 = __builtin_expect((long )tmp, 1L);   9558   tmp___0 = __builtin_expect((long )tmp, 1L);
9478   if (tmp___0) {   9559   if (tmp___0) {
9479     9560  
9480   } else {   9561   } else {
9481     vgPlain_assert_fail((Bool )0,   9562     vgPlain_assert_fail((Bool )0,
9482                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   9563                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
9483                         (Char const   *)"drd_thread.c", 420,   9564                         (Char const   *)"drd_thread.c", 420,
9484                         (Char const   *)"vgDrd_thread_set_stack_startup", "");   9565                         (Char const   *)"vgDrd_thread_set_stack_startup", "");
9485   }   9566   }
9486   tmp___1 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].stack_min <= (Addr )stack_startup))),   9567   tmp___1 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].stack_min <= (Addr )stack_startup))),
9487                              1L);   9568                              1L);
9488   if (tmp___1) {   9569   if (tmp___1) {
9489     9570  
9490   } else {   9571   } else {
9491     vgPlain_assert_fail((Bool )0,   9572     vgPlain_assert_fail((Bool )0,
9492                         (Char const   *)"DRD_(g_threadinfo)[tid].stack_min <= stack_startup",   9573                         (Char const   *)"DRD_(g_threadinfo)[tid].stack_min <= stack_startup",
9493                         (Char const   *)"drd_thread.c", 421,   9574                         (Char const   *)"drd_thread.c", 421,
9494                         (Char const   *)"vgDrd_thread_set_stack_startup", "");   9575                         (Char const   *)"vgDrd_thread_set_stack_startup", "");
9495   }   9576   }
9496   tmp___2 = __builtin_expect((long )(! (! (stack_startup <= (Addr const   )vgDrd_g_threadinfo[tid].stack_max))),   9577   tmp___2 = __builtin_expect((long )(! (! (stack_startup <= (Addr const   )vgDrd_g_threadinfo[tid].stack_max))),
9497                              1L);   9578                              1L);
9498   if (tmp___2) {   9579   if (tmp___2) {
9499     9580  
9500   } else {   9581   } else {
9501     vgPlain_assert_fail((Bool )0,   9582     vgPlain_assert_fail((Bool )0,
9502                         (Char const   *)"stack_startup <= DRD_(g_threadinfo)[tid].stack_max",   9583                         (Char const   *)"stack_startup <= DRD_(g_threadinfo)[tid].stack_max",
9503                         (Char const   *)"drd_thread.c", 422,   9584                         (Char const   *)"drd_thread.c", 422,
9504                         (Char const   *)"vgDrd_thread_set_stack_startup", "");   9585                         (Char const   *)"vgDrd_thread_set_stack_startup", "");
9505   }   9586   }
9506   vgDrd_g_threadinfo[tid].stack_startup = (Addr )stack_startup;   9587   vgDrd_g_threadinfo[tid].stack_startup = (Addr )stack_startup;
9507   return;   9588   return;
9508 }   9589 }
9509 }   9590 }
9510 Addr vgDrd_thread_get_stack_min(DrdThreadId const   tid )   9591 Addr vgDrd_thread_get_stack_min(DrdThreadId const   tid )
9511 {   9592 {
9512   int tmp ;   9593   int tmp ;
9513   long tmp___0 ;   9594   long tmp___0 ;
9514     9595  
9515   {   9596   {
9516   if (0 <= (int )tid) {   9597   if (0 <= (int )tid) {
9517     if (tid < 500U) {   9598     if (tid < 500U) {
9518       if (tid != 0U) {   9599       if (tid != 0U) {
9519         tmp = 1;   9600         tmp = 1;
9520       } else {   9601       } else {
9521         tmp = 0;   9602         tmp = 0;
9522       }   9603       }
9523     } else {   9604     } else {
9524       tmp = 0;   9605       tmp = 0;
9525     }   9606     }
9526   } else {   9607   } else {
9527     tmp = 0;   9608     tmp = 0;
9528   }   9609   }
9529   tmp___0 = __builtin_expect((long )tmp, 1L);   9610   tmp___0 = __builtin_expect((long )tmp, 1L);
9530   if (tmp___0) {   9611   if (tmp___0) {
9531     9612  
9532   } else {   9613   } else {
9533     vgPlain_assert_fail((Bool )0,   9614     vgPlain_assert_fail((Bool )0,
9534                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   9615                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
9535                         (Char const   *)"drd_thread.c", 430,   9616                         (Char const   *)"drd_thread.c", 430,
9536                         (Char const   *)"vgDrd_thread_get_stack_min", "");   9617                         (Char const   *)"vgDrd_thread_get_stack_min", "");
9537   }   9618   }
9538   return (vgDrd_g_threadinfo[tid].stack_min);   9619   return (vgDrd_g_threadinfo[tid].stack_min);
9539 }   9620 }
9540 }   9621 }
9541 Addr vgDrd_thread_get_stack_min_min(DrdThreadId const   tid )   9622 Addr vgDrd_thread_get_stack_min_min(DrdThreadId const   tid )
9542 {   9623 {
9543   int tmp ;   9624   int tmp ;
9544   long tmp___0 ;   9625   long tmp___0 ;
9545     9626  
9546   {   9627   {
9547   if (0 <= (int )tid) {   9628   if (0 <= (int )tid) {
9548     if (tid < 500U) {   9629     if (tid < 500U) {
9549       if (tid != 0U) {   9630       if (tid != 0U) {
9550         tmp = 1;   9631         tmp = 1;
9551       } else {   9632       } else {
9552         tmp = 0;   9633         tmp = 0;
9553       }   9634       }
9554     } else {   9635     } else {
9555       tmp = 0;   9636       tmp = 0;
9556     }   9637     }
9557   } else {   9638   } else {
9558     tmp = 0;   9639     tmp = 0;
9559   }   9640   }
9560   tmp___0 = __builtin_expect((long )tmp, 1L);   9641   tmp___0 = __builtin_expect((long )tmp, 1L);
9561   if (tmp___0) {   9642   if (tmp___0) {
9562     9643  
9563   } else {   9644   } else {
9564     vgPlain_assert_fail((Bool )0,   9645     vgPlain_assert_fail((Bool )0,
9565                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   9646                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
9566                         (Char const   *)"drd_thread.c", 441,   9647                         (Char const   *)"drd_thread.c", 441,
9567                         (Char const   *)"vgDrd_thread_get_stack_min_min", "");   9648                         (Char const   *)"vgDrd_thread_get_stack_min_min", "");
9568   }   9649   }
9569   return (vgDrd_g_threadinfo[tid].stack_min_min);   9650   return (vgDrd_g_threadinfo[tid].stack_min_min);
9570 }   9651 }
9571 }   9652 }
9572 Addr vgDrd_thread_get_stack_max(DrdThreadId const   tid )   9653 Addr vgDrd_thread_get_stack_max(DrdThreadId const   tid )
9573 {   9654 {
9574   int tmp ;   9655   int tmp ;
9575   long tmp___0 ;   9656   long tmp___0 ;
9576     9657  
9577   {   9658   {
9578   if (0 <= (int )tid) {   9659   if (0 <= (int )tid) {
9579     if (tid < 500U) {   9660     if (tid < 500U) {
9580       if (tid != 0U) {   9661       if (tid != 0U) {
9581         tmp = 1;   9662         tmp = 1;
9582       } else {   9663       } else {
9583         tmp = 0;   9664         tmp = 0;
9584       }   9665       }
9585     } else {   9666     } else {
9586       tmp = 0;   9667       tmp = 0;
9587     }   9668     }
9588   } else {   9669   } else {
9589     tmp = 0;   9670     tmp = 0;
9590   }   9671   }
9591   tmp___0 = __builtin_expect((long )tmp, 1L);   9672   tmp___0 = __builtin_expect((long )tmp, 1L);
9592   if (tmp___0) {   9673   if (tmp___0) {
9593     9674  
9594   } else {   9675   } else {
9595     vgPlain_assert_fail((Bool )0,   9676     vgPlain_assert_fail((Bool )0,
9596                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   9677                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
9597                         (Char const   *)"drd_thread.c", 449,   9678                         (Char const   *)"drd_thread.c", 449,
9598                         (Char const   *)"vgDrd_thread_get_stack_max", "");   9679                         (Char const   *)"vgDrd_thread_get_stack_max", "");
9599   }   9680   }
9600   return (vgDrd_g_threadinfo[tid].stack_max);   9681   return (vgDrd_g_threadinfo[tid].stack_max);
9601 }   9682 }
9602 }   9683 }
9603 SizeT vgDrd_thread_get_stack_size(DrdThreadId const   tid )   9684 SizeT vgDrd_thread_get_stack_size(DrdThreadId const   tid )
9604 {   9685 {
9605   int tmp ;   9686   int tmp ;
9606   long tmp___0 ;   9687   long tmp___0 ;
9607     9688  
9608   {   9689   {
9609   if (0 <= (int )tid) {   9690   if (0 <= (int )tid) {
9610     if (tid < 500U) {   9691     if (tid < 500U) {
9611       if (tid != 0U) {   9692       if (tid != 0U) {
9612         tmp = 1;   9693         tmp = 1;
9613       } else {   9694       } else {
9614         tmp = 0;   9695         tmp = 0;
9615       }   9696       }
9616     } else {   9697     } else {
9617       tmp = 0;   9698       tmp = 0;
9618     }   9699     }
9619   } else {   9700   } else {
9620     tmp = 0;   9701     tmp = 0;
9621   }   9702   }
9622   tmp___0 = __builtin_expect((long )tmp, 1L);   9703   tmp___0 = __builtin_expect((long )tmp, 1L);
9623   if (tmp___0) {   9704   if (tmp___0) {
9624     9705  
9625   } else {   9706   } else {
9626     vgPlain_assert_fail((Bool )0,   9707     vgPlain_assert_fail((Bool )0,
9627                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   9708                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
9628                         (Char const   *)"drd_thread.c", 457,   9709                         (Char const   *)"drd_thread.c", 457,
9629                         (Char const   *)"vgDrd_thread_get_stack_size", "");   9710                         (Char const   *)"vgDrd_thread_get_stack_size", "");
9630   }   9711   }
9631   return (vgDrd_g_threadinfo[tid].stack_size);   9712   return (vgDrd_g_threadinfo[tid].stack_size);
9632 }   9713 }
9633 }   9714 }
9634 Bool vgDrd_thread_get_on_alt_stack(DrdThreadId const   tid )   9715 Bool vgDrd_thread_get_on_alt_stack(DrdThreadId const   tid )
9635 {   9716 {
9636   int tmp ;   9717   int tmp ;
9637   long tmp___0 ;   9718   long tmp___0 ;
9638     9719  
9639   {   9720   {
9640   if (0 <= (int )tid) {   9721   if (0 <= (int )tid) {
9641     if (tid < 500U) {   9722     if (tid < 500U) {
9642       if (tid != 0U) {   9723       if (tid != 0U) {
9643         tmp = 1;   9724         tmp = 1;
9644       } else {   9725       } else {
9645         tmp = 0;   9726         tmp = 0;
9646       }   9727       }
9647     } else {   9728     } else {
9648       tmp = 0;   9729       tmp = 0;
9649     }   9730     }
9650   } else {   9731   } else {
9651     tmp = 0;   9732     tmp = 0;
9652   }   9733   }
9653   tmp___0 = __builtin_expect((long )tmp, 1L);   9734   tmp___0 = __builtin_expect((long )tmp, 1L);
9654   if (tmp___0) {   9735   if (tmp___0) {
9655     9736  
9656   } else {   9737   } else {
9657     vgPlain_assert_fail((Bool )0,   9738     vgPlain_assert_fail((Bool )0,
9658                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   9739                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
9659                         (Char const   *)"drd_thread.c", 464,   9740                         (Char const   *)"drd_thread.c", 464,
9660                         (Char const   *)"vgDrd_thread_get_on_alt_stack", "");   9741                         (Char const   *)"vgDrd_thread_get_on_alt_stack", "");
9661   }   9742   }
9662   return (vgDrd_g_threadinfo[tid].on_alt_stack);   9743   return (vgDrd_g_threadinfo[tid].on_alt_stack);
9663 }   9744 }
9664 }   9745 }
9665 void vgDrd_thread_set_on_alt_stack(DrdThreadId const   tid ,   9746 void vgDrd_thread_set_on_alt_stack(DrdThreadId const   tid ,
9666                                    Bool const   on_alt_stack )   9747                                    Bool const   on_alt_stack )
9667 {   9748 {
9668   int tmp ;   9749   int tmp ;
9669   long tmp___0 ;   9750   long tmp___0 ;
9670   long tmp___1 ;   9751   long tmp___1 ;
9671     9752  
9672   {   9753   {
9673   if (0 <= (int )tid) {   9754   if (0 <= (int )tid) {
9674     if (tid < 500U) {   9755     if (tid < 500U) {
9675       if (tid != 0U) {   9756       if (tid != 0U) {
9676         tmp = 1;   9757         tmp = 1;
9677       } else {   9758       } else {
9678         tmp = 0;   9759         tmp = 0;
9679       }   9760       }
9680     } else {   9761     } else {
9681       tmp = 0;   9762       tmp = 0;
9682     }   9763     }
9683   } else {   9764   } else {
9684     tmp = 0;   9765     tmp = 0;
9685   }   9766   }
9686   tmp___0 = __builtin_expect((long )tmp, 1L);   9767   tmp___0 = __builtin_expect((long )tmp, 1L);
9687   if (tmp___0) {   9768   if (tmp___0) {
9688     9769  
9689   } else {   9770   } else {
9690     vgPlain_assert_fail((Bool )0,   9771     vgPlain_assert_fail((Bool )0,
9691                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   9772                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
9692                         (Char const   *)"drd_thread.c", 472,   9773                         (Char const   *)"drd_thread.c", 472,
9693                         (Char const   *)"vgDrd_thread_set_on_alt_stack", "");   9774                         (Char const   *)"vgDrd_thread_set_on_alt_stack", "");
9694   }   9775   }
9695   tmp___1 = __builtin_expect((long )(! (! ((int const   )on_alt_stack == (int const   )(! (! on_alt_stack))))),   9776   tmp___1 = __builtin_expect((long )(! (! ((int const   )on_alt_stack == (int const   )(! (! on_alt_stack))))),
9696                              1L);   9777                              1L);
9697   if (tmp___1) {   9778   if (tmp___1) {
9698     9779  
9699   } else {   9780   } else {
9700     vgPlain_assert_fail((Bool )0,   9781     vgPlain_assert_fail((Bool )0,
9701                         (Char const   *)"on_alt_stack == !!on_alt_stack",   9782                         (Char const   *)"on_alt_stack == !!on_alt_stack",
9702                         (Char const   *)"drd_thread.c", 473,   9783                         (Char const   *)"drd_thread.c", 473,
9703                         (Char const   *)"vgDrd_thread_set_on_alt_stack", "");   9784                         (Char const   *)"vgDrd_thread_set_on_alt_stack", "");
9704   }   9785   }
9705   vgDrd_g_threadinfo[tid].on_alt_stack = (Bool )on_alt_stack;   9786   vgDrd_g_threadinfo[tid].on_alt_stack = (Bool )on_alt_stack;
9706   return;   9787   return;
9707 }   9788 }
9708 }   9789 }
9709 Int vgDrd_thread_get_threads_on_alt_stack(void)   9790 Int vgDrd_thread_get_threads_on_alt_stack(void)
9710 {   9791 {
9711   int i ;   9792   int i ;
9712   int n ;   9793   int n ;
9713     9794  
9714   {   9795   {
9715   n = 0;   9796   n = 0;
9716   i = 1;   9797   i = 1;
9717   while (i < 500) {   9798   while (i < 500) {
9718     n += (int )vgDrd_g_threadinfo[i].on_alt_stack;   9799     n += (int )vgDrd_g_threadinfo[i].on_alt_stack;
9719     i ++;   9800     i ++;
9720   }   9801   }
9721   return (n);   9802   return (n);
9722 }   9803 }
9723 }   9804 }
9724 void vgDrd_thread_delete(DrdThreadId const   tid , Bool const   detached )   9805 void vgDrd_thread_delete(DrdThreadId const   tid , Bool const   detached )
9725 {   9806 {
9726   Segment *sg ;   9807   Segment *sg ;
9727   Segment *sg_prev ;   9808   Segment *sg_prev ;
9728   Bool tmp ;   9809   Bool tmp ;
9729   int tmp___0 ;   9810   int tmp___0 ;
9730   long tmp___1 ;   9811   long tmp___1 ;
9731   long tmp___2 ;   9812   long tmp___2 ;
9732   long tmp___3 ;   9813   long tmp___3 ;
9733   Bool tmp___4 ;   9814   Bool tmp___4 ;
9734   int tmp___5 ;   9815   int tmp___5 ;
9735   long tmp___6 ;   9816   long tmp___6 ;
9736     9817  
9737   {   9818   {
9738   tmp = vgDrd_IsValidDrdThreadId(tid);   9819   tmp = vgDrd_IsValidDrdThreadId(tid);
9739   if (tmp) {   9820   if (tmp) {
9740     tmp___0 = 1;   9821     tmp___0 = 1;
9741   } else {   9822   } else {
9742     tmp___0 = 0;   9823     tmp___0 = 0;
9743   }   9824   }
9744   tmp___1 = __builtin_expect((long )tmp___0, 1L);   9825   tmp___1 = __builtin_expect((long )tmp___0, 1L);
9745   if (tmp___1) {   9826   if (tmp___1) {
9746     9827  
9747   } else {   9828   } else {
9748     vgPlain_assert_fail((Bool )0,   9829     vgPlain_assert_fail((Bool )0,
9749                         (Char const   *)"DRD_(IsValidDrdThreadId)(tid)",   9830                         (Char const   *)"DRD_(IsValidDrdThreadId)(tid)",
9750                         (Char const   *)"drd_thread.c", 494,   9831                         (Char const   *)"drd_thread.c", 494,
9751                         (Char const   *)"vgDrd_thread_delete", "");   9832                         (Char const   *)"vgDrd_thread_delete", "");
9752   }   9833   }
9753   tmp___2 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].synchr_nesting >= 0))),   9834   tmp___2 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].synchr_nesting >= 0))),
9754                              1L);   9835                              1L);
9755   if (tmp___2) {   9836   if (tmp___2) {
9756     9837  
9757   } else {   9838   } else {
9758     vgPlain_assert_fail((Bool )0,   9839     vgPlain_assert_fail((Bool )0,
9759                         (Char const   *)"DRD_(g_threadinfo)[tid].synchr_nesting >= 0",   9840                         (Char const   *)"DRD_(g_threadinfo)[tid].synchr_nesting >= 0",
9760                         (Char const   *)"drd_thread.c", 496,   9841                         (Char const   *)"drd_thread.c", 496,
9761                         (Char const   *)"vgDrd_thread_delete", "");   9842                         (Char const   *)"vgDrd_thread_delete", "");
9762   }   9843   }
9763   sg = vgDrd_g_threadinfo[tid].sg_last;   9844   sg = vgDrd_g_threadinfo[tid].sg_last;
9764   while (sg) {   9845   while (sg) {
9765     sg_prev = sg->thr_prev;   9846     sg_prev = sg->thr_prev;
9766     sg->thr_next = (struct segment *)((void *)0);   9847     sg->thr_next = (struct segment *)((void *)0);
9767     sg->thr_prev = (struct segment *)((void *)0);   9848     sg->thr_prev = (struct segment *)((void *)0);
9768     vgDrd_sg_put((Segment */* const  */)sg);   9849     vgDrd_sg_put((Segment */* const  */)sg);
9769     sg = sg_prev;   9850     sg = sg_prev;
9770   }   9851   }
9771   vgDrd_g_threadinfo[tid].valid = (Bool )0;   9852   vgDrd_g_threadinfo[tid].valid = (Bool )0;
9772   vgDrd_g_threadinfo[tid].vg_thread_exists = (Bool )0;   9853   vgDrd_g_threadinfo[tid].vg_thread_exists = (Bool )0;
9773   vgDrd_g_threadinfo[tid].posix_thread_exists = (Bool )0;   9854   vgDrd_g_threadinfo[tid].posix_thread_exists = (Bool )0;
9774   if (detached) {   9855   if (detached) {
9775     vgDrd_g_threadinfo[tid].detached_posix_thread = (Bool )0;   9856     vgDrd_g_threadinfo[tid].detached_posix_thread = (Bool )0;
9776   } else {   9857   } else {
9777     tmp___3 = __builtin_expect((long )(! (! (! vgDrd_g_threadinfo[tid].detached_posix_thread))),   9858     tmp___3 = __builtin_expect((long )(! (! (! vgDrd_g_threadinfo[tid].detached_posix_thread))),
9778                                1L);   9859                                1L);
9779     if (tmp___3) {   9860     if (tmp___3) {
9780     9861  
9781     } else {   9862     } else {
9782       vgPlain_assert_fail((Bool )0,   9863       vgPlain_assert_fail((Bool )0,
9783                           (Char const   *)"!DRD_(g_threadinfo)[tid].detached_posix_thread",   9864                           (Char const   *)"!DRD_(g_threadinfo)[tid].detached_posix_thread",
9784                           (Char const   *)"drd_thread.c", 509,   9865                           (Char const   *)"drd_thread.c", 509,
9785                           (Char const   *)"vgDrd_thread_delete", "");   9866                           (Char const   *)"vgDrd_thread_delete", "");
9786     }   9867     }
9787   }   9868   }
9788   vgDrd_g_threadinfo[tid].sg_first = (struct segment *)((void *)0);   9869   vgDrd_g_threadinfo[tid].sg_first = (struct segment *)((void *)0);
9789   vgDrd_g_threadinfo[tid].sg_last = (struct segment *)((void *)0);   9870   vgDrd_g_threadinfo[tid].sg_last = (struct segment *)((void *)0);
9790   tmp___4 = vgDrd_IsValidDrdThreadId(tid);   9871   tmp___4 = vgDrd_IsValidDrdThreadId(tid);
9791   if (tmp___4) {   9872   if (tmp___4) {
9792     tmp___5 = 0;   9873     tmp___5 = 0;
9793   } else {   9874   } else {
9794     tmp___5 = 1;   9875     tmp___5 = 1;
9795   }   9876   }
9796   tmp___6 = __builtin_expect((long )tmp___5, 1L);   9877   tmp___6 = __builtin_expect((long )tmp___5, 1L);
9797   if (tmp___6) {   9878   if (tmp___6) {
9798     9879  
9799   } else {   9880   } else {
9800     vgPlain_assert_fail((Bool )0,   9881     vgPlain_assert_fail((Bool )0,
9801                         (Char const   *)"!DRD_(IsValidDrdThreadId)(tid)",   9882                         (Char const   *)"!DRD_(IsValidDrdThreadId)(tid)",
9802                         (Char const   *)"drd_thread.c", 513,   9883                         (Char const   *)"drd_thread.c", 513,
9803                         (Char const   *)"vgDrd_thread_delete", "");   9884                         (Char const   *)"vgDrd_thread_delete", "");
9804   }   9885   }
9805   return;   9886   return;
9806 }   9887 }
9807 }   9888 }
9808 void vgDrd_thread_finished(DrdThreadId const   tid )   9889 void vgDrd_thread_finished(DrdThreadId const   tid )
9809 {   9890 {
9810   int tmp ;   9891   int tmp ;
9811   long tmp___0 ;   9892   long tmp___0 ;
9812     9893  
9813   {   9894   {
9814   if (0 <= (int )tid) {   9895   if (0 <= (int )tid) {
9815     if (tid < 500U) {   9896     if (tid < 500U) {
9816       if (tid != 0U) {   9897       if (tid != 0U) {
9817         tmp = 1;   9898         tmp = 1;
9818       } else {   9899       } else {
9819         tmp = 0;   9900         tmp = 0;
9820       }   9901       }
9821     } else {   9902     } else {
9822       tmp = 0;   9903       tmp = 0;
9823     }   9904     }
9824   } else {   9905   } else {
9825     tmp = 0;   9906     tmp = 0;
9826   }   9907   }
9827   tmp___0 = __builtin_expect((long )tmp, 1L);   9908   tmp___0 = __builtin_expect((long )tmp, 1L);
9828   if (tmp___0) {   9909   if (tmp___0) {
9829     9910  
9830   } else {   9911   } else {
9831     vgPlain_assert_fail((Bool )0,   9912     vgPlain_assert_fail((Bool )0,
9832                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   9913                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
9833                         (Char const   *)"drd_thread.c", 524,   9914                         (Char const   *)"drd_thread.c", 524,
9834                         (Char const   *)"vgDrd_thread_finished", "");   9915                         (Char const   *)"vgDrd_thread_finished", "");
9835   }   9916   }
9836   vgDrd_g_threadinfo[tid].vg_thread_exists = (Bool )0;   9917   vgDrd_g_threadinfo[tid].vg_thread_exists = (Bool )0;
9837   if (vgDrd_g_threadinfo[tid].detached_posix_thread) {   9918   if (vgDrd_g_threadinfo[tid].detached_posix_thread) {
9838     vgDrd_g_threadinfo[tid].stack_min = vgDrd_g_threadinfo[tid].stack_max;   9919     vgDrd_g_threadinfo[tid].stack_min = vgDrd_g_threadinfo[tid].stack_max;
9839     vgDrd_g_threadinfo[tid].posix_thread_exists = (Bool )0;   9920     vgDrd_g_threadinfo[tid].posix_thread_exists = (Bool )0;
9840   } else {   9921   } else {
9841     9922  
9842   }   9923   }
9843   return;   9924   return;
9844 }   9925 }
9845 }   9926 }
9846 void vgDrd_drd_thread_atfork_child(DrdThreadId const   tid )   9927 void vgDrd_drd_thread_atfork_child(DrdThreadId const   tid )
9847 {   9928 {
9848   unsigned int i ;   9929   unsigned int i ;
9849   Bool tmp ;   9930   Bool tmp ;
9850   Bool tmp___0 ;   9931   Bool tmp___0 ;
9851   int tmp___1 ;   9932   int tmp___1 ;
9852   long tmp___2 ;   9933   long tmp___2 ;
9853     9934  
9854   {   9935   {
9855   i = 1U;   9936   i = 1U;
9856   while (i < 500U) {   9937   while (i < 500U) {
9857     if (i == (unsigned int )tid) {   9938     if (i == (unsigned int )tid) {
9858       goto __Cont;   9939       goto __Cont;
9859     } else {   9940     } else {
9860     9941  
9861     }   9942     }
9862     tmp = vgDrd_IsValidDrdThreadId((DrdThreadId const   )i);   9943     tmp = vgDrd_IsValidDrdThreadId((DrdThreadId const   )i);
9863     if (tmp) {   9944     if (tmp) {
9864       vgDrd_thread_delete((DrdThreadId const   )i, (Bool const   )((Bool )1));   9945       vgDrd_thread_delete((DrdThreadId const   )i, (Bool const   )((Bool )1));
9865     } else {   9946     } else {
9866     9947  
9867     }   9948     }
9868     tmp___0 = vgDrd_IsValidDrdThreadId((DrdThreadId const   )i);   9949     tmp___0 = vgDrd_IsValidDrdThreadId((DrdThreadId const   )i);
9869     if (tmp___0) {   9950     if (tmp___0) {
9870       tmp___1 = 0;   9951       tmp___1 = 0;
9871     } else {   9952     } else {
9872       tmp___1 = 1;   9953       tmp___1 = 1;
9873     }   9954     }
9874     tmp___2 = __builtin_expect((long )tmp___1, 1L);   9955     tmp___2 = __builtin_expect((long )tmp___1, 1L);
9875     if (tmp___2) {   9956     if (tmp___2) {
9876     9957  
9877     } else {   9958     } else {
9878       vgPlain_assert_fail((Bool )0,   9959       vgPlain_assert_fail((Bool )0,
9879                           (Char const   *)"!DRD_(IsValidDrdThreadId(i))",   9960                           (Char const   *)"!DRD_(IsValidDrdThreadId(i))",
9880                           (Char const   *)"drd_thread.c", 557,   9961                           (Char const   *)"drd_thread.c", 557,
9881                           (Char const   *)"vgDrd_drd_thread_atfork_child", "");   9962                           (Char const   *)"vgDrd_drd_thread_atfork_child", "");
9882     }   9963     }
9883     __Cont: /* CIL Label */   9964     __Cont: /* CIL Label */
9884     i ++;   9965     i ++;
9885   }   9966   }
9886   return;   9967   return;
9887 }   9968 }
9888 }   9969 }
9889 void vgDrd_thread_pre_cancel(DrdThreadId const   tid )   9970 void vgDrd_thread_pre_cancel(DrdThreadId const   tid )
9890 {   9971 {
9891   int tmp ;   9972   int tmp ;
9892   long tmp___0 ;   9973   long tmp___0 ;
9893   long tmp___1 ;   9974   long tmp___1 ;
9894   Bool tmp___2 ;   9975   Bool tmp___2 ;
9895     9976  
9896   {   9977   {
9897   if (0 <= (int )tid) {   9978   if (0 <= (int )tid) {
9898     if (tid < 500U) {   9979     if (tid < 500U) {
9899       if (tid != 0U) {   9980       if (tid != 0U) {
9900         tmp = 1;   9981         tmp = 1;
9901       } else {   9982       } else {
9902         tmp = 0;   9983         tmp = 0;
9903       }   9984       }
9904     } else {   9985     } else {
9905       tmp = 0;   9986       tmp = 0;
9906     }   9987     }
9907   } else {   9988   } else {
9908     tmp = 0;   9989     tmp = 0;
9909   }   9990   }
9910   tmp___0 = __builtin_expect((long )tmp, 1L);   9991   tmp___0 = __builtin_expect((long )tmp, 1L);
9911   if (tmp___0) {   9992   if (tmp___0) {
9912     9993  
9913   } else {   9994   } else {
9914     vgPlain_assert_fail((Bool )0,   9995     vgPlain_assert_fail((Bool )0,
9915                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   9996                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
9916                         (Char const   *)"drd_thread.c", 565,   9997                         (Char const   *)"drd_thread.c", 565,
9917                         (Char const   *)"vgDrd_thread_pre_cancel", "");   9998                         (Char const   *)"vgDrd_thread_pre_cancel", "");
9918   }   9999   }
9919   tmp___1 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].pt_threadid != 0UL))),   10000   tmp___1 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].pt_threadid != 0UL))),
9920                              1L);   10001                              1L);
9921   if (tmp___1) {   10002   if (tmp___1) {
9922     10003  
9923   } else {   10004   } else {
9924     vgPlain_assert_fail((Bool )0,   10005     vgPlain_assert_fail((Bool )0,
9925                         (Char const   *)"DRD_(g_threadinfo)[tid].pt_threadid != INVALID_POSIX_THREADID",   10006                         (Char const   *)"DRD_(g_threadinfo)[tid].pt_threadid != INVALID_POSIX_THREADID",
9926                         (Char const   *)"drd_thread.c", 566,   10007                         (Char const   *)"drd_thread.c", 566,
9927                         (Char const   *)"vgDrd_thread_pre_cancel", "");   10008                         (Char const   *)"vgDrd_thread_pre_cancel", "");
9928   }   10009   }
9929   tmp___2 = vgDrd_thread_get_trace_fork_join();   10010   tmp___2 = vgDrd_thread_get_trace_fork_join();
9930   if (tmp___2) {   10011   if (tmp___2) {
9931     vgDrd_trace_msg("[%d] drd_thread_pre_cancel %d", vgDrd_g_drd_running_tid,   10012     vgDrd_trace_msg("[%d] drd_thread_pre_cancel %d", vgDrd_g_drd_running_tid,
9932                     tid);   10013                     tid);
9933   } else {   10014   } else {
9934     10015  
9935   }   10016   }
9936   return;   10017   return;
9937 }   10018 }
9938 }   10019 }
9939 void vgDrd_thread_set_pthreadid(DrdThreadId const   tid ,   10020 void vgDrd_thread_set_pthreadid(DrdThreadId const   tid ,
9940                                 PThreadId const   ptid )   10021                                 PThreadId const   ptid )
9941 {   10022 {
9942   int tmp ;   10023   int tmp ;
9943   long tmp___0 ;   10024   long tmp___0 ;
9944   int tmp___1 ;   10025   int tmp___1 ;
9945   long tmp___2 ;   10026   long tmp___2 ;
9946   long tmp___3 ;   10027   long tmp___3 ;
9947     10028  
9948   {   10029   {
9949   if (0 <= (int )tid) {   10030   if (0 <= (int )tid) {
9950     if (tid < 500U) {   10031     if (tid < 500U) {
9951       if (tid != 0U) {   10032       if (tid != 0U) {
9952         tmp = 1;   10033         tmp = 1;
9953       } else {   10034       } else {
9954         tmp = 0;   10035         tmp = 0;
9955       }   10036       }
9956     } else {   10037     } else {
9957       tmp = 0;   10038       tmp = 0;
9958     }   10039     }
9959   } else {   10040   } else {
9960     tmp = 0;   10041     tmp = 0;
9961   }   10042   }
9962   tmp___0 = __builtin_expect((long )tmp, 1L);   10043   tmp___0 = __builtin_expect((long )tmp, 1L);
9963   if (tmp___0) {   10044   if (tmp___0) {
9964     10045  
9965   } else {   10046   } else {
9966     vgPlain_assert_fail((Bool )0,   10047     vgPlain_assert_fail((Bool )0,
9967                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   10048                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
9968                         (Char const   *)"drd_thread.c", 583,   10049                         (Char const   *)"drd_thread.c", 583,
9969                         (Char const   *)"vgDrd_thread_set_pthreadid", "");   10050                         (Char const   *)"vgDrd_thread_set_pthreadid", "");
9970   }   10051   }
9971   if (vgDrd_g_threadinfo[tid].pt_threadid == 0UL) {   10052   if (vgDrd_g_threadinfo[tid].pt_threadid == 0UL) {
9972     tmp___1 = 1;   10053     tmp___1 = 1;
9973   } else   10054   } else
9974   if (vgDrd_g_threadinfo[tid].pt_threadid == (PThreadId )ptid) {   10055   if (vgDrd_g_threadinfo[tid].pt_threadid == (PThreadId )ptid) {
9975     tmp___1 = 1;   10056     tmp___1 = 1;
9976   } else {   10057   } else {
9977     tmp___1 = 0;   10058     tmp___1 = 0;
9978   }   10059   }
9979   tmp___2 = __builtin_expect((long )tmp___1, 1L);   10060   tmp___2 = __builtin_expect((long )tmp___1, 1L);
9980   if (tmp___2) {   10061   if (tmp___2) {
9981     10062  
9982   } else {   10063   } else {
9983     vgPlain_assert_fail((Bool )0,   10064     vgPlain_assert_fail((Bool )0,
9984                         (Char const   *)"DRD_(g_threadinfo)[tid].pt_threadid == INVALID_POSIX_THREADID || DRD_(g_threadinfo)[tid].pt_threadid == ptid",   10065                         (Char const   *)"DRD_(g_threadinfo)[tid].pt_threadid == INVALID_POSIX_THREADID || DRD_(g_threadinfo)[tid].pt_threadid == ptid",
9985                         (Char const   *)"drd_thread.c", 585,   10066                         (Char const   *)"drd_thread.c", 585,
9986                         (Char const   *)"vgDrd_thread_set_pthreadid", "");   10067                         (Char const   *)"vgDrd_thread_set_pthreadid", "");
9987   }   10068   }
9988   tmp___3 = __builtin_expect((long )(! (! (ptid != 0UL))), 1L);   10069   tmp___3 = __builtin_expect((long )(! (! (ptid != 0UL))), 1L);
9989   if (tmp___3) {   10070   if (tmp___3) {
9990     10071  
9991   } else {   10072   } else {
9992     vgPlain_assert_fail((Bool )0,   10073     vgPlain_assert_fail((Bool )0,
9993                         (Char const   *)"ptid != INVALID_POSIX_THREADID",   10074                         (Char const   *)"ptid != INVALID_POSIX_THREADID",
9994                         (Char const   *)"drd_thread.c", 586,   10075                         (Char const   *)"drd_thread.c", 586,
9995                         (Char const   *)"vgDrd_thread_set_pthreadid", "");   10076                         (Char const   *)"vgDrd_thread_set_pthreadid", "");
9996   }   10077   }
9997   vgDrd_g_threadinfo[tid].posix_thread_exists = (Bool )1;   10078   vgDrd_g_threadinfo[tid].posix_thread_exists = (Bool )1;
9998   vgDrd_g_threadinfo[tid].pt_threadid = (PThreadId )ptid;   10079   vgDrd_g_threadinfo[tid].pt_threadid = (PThreadId )ptid;
9999   return;   10080   return;
10000 }   10081 }
10001 }   10082 }
10002 Bool vgDrd_thread_get_joinable(DrdThreadId const   tid )   10083 Bool vgDrd_thread_get_joinable(DrdThreadId const   tid )
10003 {   10084 {
10004   int tmp ;   10085   int tmp ;
10005   long tmp___0 ;   10086   long tmp___0 ;
10006     10087  
10007   {   10088   {
10008   if (0 <= (int )tid) {   10089   if (0 <= (int )tid) {
10009     if (tid < 500U) {   10090     if (tid < 500U) {
10010       if (tid != 0U) {   10091       if (tid != 0U) {
10011         tmp = 1;   10092         tmp = 1;
10012       } else {   10093       } else {
10013         tmp = 0;   10094         tmp = 0;
10014       }   10095       }
10015     } else {   10096     } else {
10016       tmp = 0;   10097       tmp = 0;
10017     }   10098     }
10018   } else {   10099   } else {
10019     tmp = 0;   10100     tmp = 0;
10020   }   10101   }
10021   tmp___0 = __builtin_expect((long )tmp, 1L);   10102   tmp___0 = __builtin_expect((long )tmp, 1L);
10022   if (tmp___0) {   10103   if (tmp___0) {
10023     10104  
10024   } else {   10105   } else {
10025     vgPlain_assert_fail((Bool )0,   10106     vgPlain_assert_fail((Bool )0,
10026                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   10107                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
10027                         (Char const   *)"drd_thread.c", 595,   10108                         (Char const   *)"drd_thread.c", 595,
10028                         (Char const   *)"vgDrd_thread_get_joinable", "");   10109                         (Char const   *)"vgDrd_thread_get_joinable", "");
10029   }   10110   }
10030   return ((Bool )(! vgDrd_g_threadinfo[tid].detached_posix_thread));   10111   return ((Bool )(! vgDrd_g_threadinfo[tid].detached_posix_thread));
10031 }   10112 }
10032 }   10113 }
10033 void vgDrd_thread_set_joinable(DrdThreadId const   tid , Bool const   joinable )   10114 void vgDrd_thread_set_joinable(DrdThreadId const   tid , Bool const   joinable )
10034 {   10115 {
10035   int tmp ;   10116   int tmp ;
10036   long tmp___0 ;   10117   long tmp___0 ;
10037   long tmp___1 ;   10118   long tmp___1 ;
10038   long tmp___2 ;   10119   long tmp___2 ;
10039     10120  
10040   {   10121   {
10041   if (0 <= (int )tid) {   10122   if (0 <= (int )tid) {
10042     if (tid < 500U) {   10123     if (tid < 500U) {
10043       if (tid != 0U) {   10124       if (tid != 0U) {
10044         tmp = 1;   10125         tmp = 1;
10045       } else {   10126       } else {
10046         tmp = 0;   10127         tmp = 0;
10047       }   10128       }
10048     } else {   10129     } else {
10049       tmp = 0;   10130       tmp = 0;
10050     }   10131     }
10051   } else {   10132   } else {
10052     tmp = 0;   10133     tmp = 0;
10053   }   10134   }
10054   tmp___0 = __builtin_expect((long )tmp, 1L);   10135   tmp___0 = __builtin_expect((long )tmp, 1L);
10055   if (tmp___0) {   10136   if (tmp___0) {
10056     10137  
10057   } else {   10138   } else {
10058     vgPlain_assert_fail((Bool )0,   10139     vgPlain_assert_fail((Bool )0,
10059                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   10140                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
10060                         (Char const   *)"drd_thread.c", 603,   10141                         (Char const   *)"drd_thread.c", 603,
10061                         (Char const   *)"vgDrd_thread_set_joinable", "");   10142                         (Char const   *)"vgDrd_thread_set_joinable", "");
10062   }   10143   }
10063   tmp___1 = __builtin_expect((long )(! (! (! (! joinable) == (int )joinable))),   10144   tmp___1 = __builtin_expect((long )(! (! (! (! joinable) == (int )joinable))),
10064                              1L);   10145                              1L);
10065   if (tmp___1) {   10146   if (tmp___1) {
10066     10147  
10067   } else {   10148   } else {
10068     vgPlain_assert_fail((Bool )0, (Char const   *)"!! joinable == joinable",   10149     vgPlain_assert_fail((Bool )0, (Char const   *)"!! joinable == joinable",
10069                         (Char const   *)"drd_thread.c", 604,   10150                         (Char const   *)"drd_thread.c", 604,
10070                         (Char const   *)"vgDrd_thread_set_joinable", "");   10151                         (Char const   *)"vgDrd_thread_set_joinable", "");
10071   }   10152   }
10072   tmp___2 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].pt_threadid != 0UL))),   10153   tmp___2 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].pt_threadid != 0UL))),
10073                              1L);   10154                              1L);
10074   if (tmp___2) {   10155   if (tmp___2) {
10075     10156  
10076   } else {   10157   } else {
10077     vgPlain_assert_fail((Bool )0,   10158     vgPlain_assert_fail((Bool )0,
10078                         (Char const   *)"DRD_(g_threadinfo)[tid].pt_threadid != INVALID_POSIX_THREADID",   10159                         (Char const   *)"DRD_(g_threadinfo)[tid].pt_threadid != INVALID_POSIX_THREADID",
10079                         (Char const   *)"drd_thread.c", 605,   10160                         (Char const   *)"drd_thread.c", 605,
10080                         (Char const   *)"vgDrd_thread_set_joinable", "");   10161                         (Char const   *)"vgDrd_thread_set_joinable", "");
10081   }   10162   }
10082   vgDrd_g_threadinfo[tid].detached_posix_thread = (Bool )(! joinable);   10163   vgDrd_g_threadinfo[tid].detached_posix_thread = (Bool )(! joinable);
10083   return;   10164   return;
10084 }   10165 }
10085 }   10166 }
10086 void vgDrd_thread_entering_pthread_create(DrdThreadId const   tid )   10167 void vgDrd_thread_entering_pthread_create(DrdThreadId const   tid )
10087 {   10168 {
10088   int tmp ;   10169   int tmp ;
10089   long tmp___0 ;   10170   long tmp___0 ;
10090   long tmp___1 ;   10171   long tmp___1 ;
10091   long tmp___2 ;   10172   long tmp___2 ;
10092     10173  
10093   {   10174   {
10094   if (0 <= (int )tid) {   10175   if (0 <= (int )tid) {
10095     if (tid < 500U) {   10176     if (tid < 500U) {
10096       if (tid != 0U) {   10177       if (tid != 0U) {
10097         tmp = 1;   10178         tmp = 1;
10098       } else {   10179       } else {
10099         tmp = 0;   10180         tmp = 0;
10100       }   10181       }
10101     } else {   10182     } else {
10102       tmp = 0;   10183       tmp = 0;
10103     }   10184     }
10104   } else {   10185   } else {
10105     tmp = 0;   10186     tmp = 0;
10106   }   10187   }
10107   tmp___0 = __builtin_expect((long )tmp, 1L);   10188   tmp___0 = __builtin_expect((long )tmp, 1L);
10108   if (tmp___0) {   10189   if (tmp___0) {
10109     10190  
10110   } else {   10191   } else {
10111     vgPlain_assert_fail((Bool )0,   10192     vgPlain_assert_fail((Bool )0,
10112                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   10193                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
10113                         (Char const   *)"drd_thread.c", 614,   10194                         (Char const   *)"drd_thread.c", 614,
10114                         (Char const   *)"vgDrd_thread_entering_pthread_create",   10195                         (Char const   *)"vgDrd_thread_entering_pthread_create",
10115                         "");   10196                         "");
10116   }   10197   }
10117   tmp___1 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].pt_threadid != 0UL))),   10198   tmp___1 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].pt_threadid != 0UL))),
10118                              1L);   10199                              1L);
10119   if (tmp___1) {   10200   if (tmp___1) {
10120     10201  
10121   } else {   10202   } else {
10122     vgPlain_assert_fail((Bool )0,   10203     vgPlain_assert_fail((Bool )0,
10123                         (Char const   *)"DRD_(g_threadinfo)[tid].pt_threadid != INVALID_POSIX_THREADID",   10204                         (Char const   *)"DRD_(g_threadinfo)[tid].pt_threadid != INVALID_POSIX_THREADID",
10124                         (Char const   *)"drd_thread.c", 615,   10205                         (Char const   *)"drd_thread.c", 615,
10125                         (Char const   *)"vgDrd_thread_entering_pthread_create",   10206                         (Char const   *)"vgDrd_thread_entering_pthread_create",
10126                         "");   10207                         "");
10127   }   10208   }
10128   tmp___2 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].pthread_create_nesting_level >= 0))),   10209   tmp___2 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].pthread_create_nesting_level >= 0))),
10129                              1L);   10210                              1L);
10130   if (tmp___2) {   10211   if (tmp___2) {
10131     10212  
10132   } else {   10213   } else {
10133     vgPlain_assert_fail((Bool )0,   10214     vgPlain_assert_fail((Bool )0,
10134                         (Char const   *)"DRD_(g_threadinfo)[tid].pthread_create_nesting_level >= 0",   10215                         (Char const   *)"DRD_(g_threadinfo)[tid].pthread_create_nesting_level >= 0",
10135                         (Char const   *)"drd_thread.c", 616,   10216                         (Char const   *)"drd_thread.c", 616,
10136                         (Char const   *)"vgDrd_thread_entering_pthread_create",   10217                         (Char const   *)"vgDrd_thread_entering_pthread_create",
10137                         "");   10218                         "");
10138   }   10219   }
10139   (vgDrd_g_threadinfo[tid].pthread_create_nesting_level) ++;   10220   (vgDrd_g_threadinfo[tid].pthread_create_nesting_level) ++;
10140   return;   10221   return;
10141 }   10222 }
10142 }   10223 }
10143 void vgDrd_thread_left_pthread_create(DrdThreadId const   tid )   10224 void vgDrd_thread_left_pthread_create(DrdThreadId const   tid )
10144 {   10225 {
10145   int tmp ;   10226   int tmp ;
10146   long tmp___0 ;   10227   long tmp___0 ;
10147   long tmp___1 ;   10228   long tmp___1 ;
10148   long tmp___2 ;   10229   long tmp___2 ;
10149     10230  
10150   {   10231   {
10151   if (0 <= (int )tid) {   10232   if (0 <= (int )tid) {
10152     if (tid < 500U) {   10233     if (tid < 500U) {
10153       if (tid != 0U) {   10234       if (tid != 0U) {
10154         tmp = 1;   10235         tmp = 1;
10155       } else {   10236       } else {
10156         tmp = 0;   10237         tmp = 0;
10157       }   10238       }
10158     } else {   10239     } else {
10159       tmp = 0;   10240       tmp = 0;
10160     }   10241     }
10161   } else {   10242   } else {
10162     tmp = 0;   10243     tmp = 0;
10163   }   10244   }
10164   tmp___0 = __builtin_expect((long )tmp, 1L);   10245   tmp___0 = __builtin_expect((long )tmp, 1L);
10165   if (tmp___0) {   10246   if (tmp___0) {
10166     10247  
10167   } else {   10248   } else {
10168     vgPlain_assert_fail((Bool )0,   10249     vgPlain_assert_fail((Bool )0,
10169                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   10250                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
10170                         (Char const   *)"drd_thread.c", 625,   10251                         (Char const   *)"drd_thread.c", 625,
10171                         (Char const   *)"vgDrd_thread_left_pthread_create", "");   10252                         (Char const   *)"vgDrd_thread_left_pthread_create", "");
10172   }   10253   }
10173   tmp___1 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].pt_threadid != 0UL))),   10254   tmp___1 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].pt_threadid != 0UL))),
10174                              1L);   10255                              1L);
10175   if (tmp___1) {   10256   if (tmp___1) {
10176     10257  
10177   } else {   10258   } else {
10178     vgPlain_assert_fail((Bool )0,   10259     vgPlain_assert_fail((Bool )0,
10179                         (Char const   *)"DRD_(g_threadinfo)[tid].pt_threadid != INVALID_POSIX_THREADID",   10260                         (Char const   *)"DRD_(g_threadinfo)[tid].pt_threadid != INVALID_POSIX_THREADID",
10180                         (Char const   *)"drd_thread.c", 626,   10261                         (Char const   *)"drd_thread.c", 626,
10181                         (Char const   *)"vgDrd_thread_left_pthread_create", "");   10262                         (Char const   *)"vgDrd_thread_left_pthread_create", "");
10182   }   10263   }
10183   tmp___2 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].pthread_create_nesting_level > 0))),   10264   tmp___2 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].pthread_create_nesting_level > 0))),
10184                              1L);   10265                              1L);
10185   if (tmp___2) {   10266   if (tmp___2) {
10186     10267  
10187   } else {   10268   } else {
10188     vgPlain_assert_fail((Bool )0,   10269     vgPlain_assert_fail((Bool )0,
10189                         (Char const   *)"DRD_(g_threadinfo)[tid].pthread_create_nesting_level > 0",   10270                         (Char const   *)"DRD_(g_threadinfo)[tid].pthread_create_nesting_level > 0",
10190                         (Char const   *)"drd_thread.c", 627,   10271                         (Char const   *)"drd_thread.c", 627,
10191                         (Char const   *)"vgDrd_thread_left_pthread_create", "");   10272                         (Char const   *)"vgDrd_thread_left_pthread_create", "");
10192   }   10273   }
10193   (vgDrd_g_threadinfo[tid].pthread_create_nesting_level) --;   10274   (vgDrd_g_threadinfo[tid].pthread_create_nesting_level) --;
10194   return;   10275   return;
10195 }   10276 }
10196 }   10277 }
10197 char const   *vgDrd_thread_get_name(DrdThreadId const   tid )   10278 char const   *vgDrd_thread_get_name(DrdThreadId const   tid )
10198 {   10279 {
10199   int tmp ;   10280   int tmp ;
10200   long tmp___0 ;   10281   long tmp___0 ;
10201     10282  
10202   {   10283   {
10203   if (0 <= (int )tid) {   10284   if (0 <= (int )tid) {
10204     if (tid < 500U) {   10285     if (tid < 500U) {
10205       if (tid != 0U) {   10286       if (tid != 0U) {
10206         tmp = 1;   10287         tmp = 1;
10207       } else {   10288       } else {
10208         tmp = 0;   10289         tmp = 0;
10209       }   10290       }
10210     } else {   10291     } else {
10211       tmp = 0;   10292       tmp = 0;
10212     }   10293     }
10213   } else {   10294   } else {
10214     tmp = 0;   10295     tmp = 0;
10215   }   10296   }
10216   tmp___0 = __builtin_expect((long )tmp, 1L);   10297   tmp___0 = __builtin_expect((long )tmp, 1L);
10217   if (tmp___0) {   10298   if (tmp___0) {
10218     10299  
10219   } else {   10300   } else {
10220     vgPlain_assert_fail((Bool )0,   10301     vgPlain_assert_fail((Bool )0,
10221                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   10302                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
10222                         (Char const   *)"drd_thread.c", 636,   10303                         (Char const   *)"drd_thread.c", 636,
10223                         (Char const   *)"vgDrd_thread_get_name", "");   10304                         (Char const   *)"vgDrd_thread_get_name", "");
10224   }   10305   }
10225   return ((char const   *)(vgDrd_g_threadinfo[tid].name));   10306   return ((char const   *)(vgDrd_g_threadinfo[tid].name));
10226 }   10307 }
10227 }   10308 }
10228 void vgDrd_thread_set_name(DrdThreadId const   tid , char const   * const  name )   10309 void vgDrd_thread_set_name(DrdThreadId const   tid , char const   * const  name )
10229 {   10310 {
10230   int tmp ;   10311   int tmp ;
10231   long tmp___0 ;   10312   long tmp___0 ;
10232     10313  
10233   {   10314   {
10234   if (0 <= (int )tid) {   10315   if (0 <= (int )tid) {
10235     if (tid < 500U) {   10316     if (tid < 500U) {
10236       if (tid != 0U) {   10317       if (tid != 0U) {
10237         tmp = 1;   10318         tmp = 1;
10238       } else {   10319       } else {
10239         tmp = 0;   10320         tmp = 0;
10240       }   10321       }
10241     } else {   10322     } else {
10242       tmp = 0;   10323       tmp = 0;
10243     }   10324     }
10244   } else {   10325   } else {
10245     tmp = 0;   10326     tmp = 0;
10246   }   10327   }
10247   tmp___0 = __builtin_expect((long )tmp, 1L);   10328   tmp___0 = __builtin_expect((long )tmp, 1L);
10248   if (tmp___0) {   10329   if (tmp___0) {
10249     10330  
10250   } else {   10331   } else {
10251     vgPlain_assert_fail((Bool )0,   10332     vgPlain_assert_fail((Bool )0,
10252                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   10333                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
10253                         (Char const   *)"drd_thread.c", 645,   10334                         (Char const   *)"drd_thread.c", 645,
10254                         (Char const   *)"vgDrd_thread_set_name", "");   10335                         (Char const   *)"vgDrd_thread_set_name", "");
10255   }   10336   }
10256   if ((unsigned int )name == (unsigned int )((void *)0)) {   10337   if ((unsigned int )name == (unsigned int )((void *)0)) {
10257     vgPlain_snprintf((Char *)(vgDrd_g_threadinfo[tid].name),   10338     vgPlain_snprintf((Char *)(vgDrd_g_threadinfo[tid].name),
10258                      (Int )sizeof(vgDrd_g_threadinfo[tid].name), "Thread %d",   10339                      (Int )sizeof(vgDrd_g_threadinfo[tid].name), "Thread %d",
10259                      tid);   10340                      tid);
10260   } else   10341   } else
10261   if ((int const   )*(name + 0) == 0) {   10342   if ((int const   )*(name + 0) == 0) {
10262     vgPlain_snprintf((Char *)(vgDrd_g_threadinfo[tid].name),   10343     vgPlain_snprintf((Char *)(vgDrd_g_threadinfo[tid].name),
10263                      (Int )sizeof(vgDrd_g_threadinfo[tid].name), "Thread %d",   10344                      (Int )sizeof(vgDrd_g_threadinfo[tid].name), "Thread %d",
10264                      tid);   10345                      tid);
10265   } else {   10346   } else {
10266     vgPlain_snprintf((Char *)(vgDrd_g_threadinfo[tid].name),   10347     vgPlain_snprintf((Char *)(vgDrd_g_threadinfo[tid].name),
10267                      (Int )sizeof(vgDrd_g_threadinfo[tid].name),   10348                      (Int )sizeof(vgDrd_g_threadinfo[tid].name),
10268                      "Thread %d (%s)", tid, name);   10349                      "Thread %d (%s)", tid, name);
10269   }   10350   }
10270   vgDrd_g_threadinfo[tid].name[sizeof(vgDrd_g_threadinfo[tid].name) - 1U] = (char)0;   10351   vgDrd_g_threadinfo[tid].name[sizeof(vgDrd_g_threadinfo[tid].name) - 1U] = (char)0;
10271   return;   10352   return;
10272 }   10353 }
10273 }   10354 }
10274 void vgDrd_thread_set_vg_running_tid(ThreadId const   vg_tid )   10355 void vgDrd_thread_set_vg_running_tid(ThreadId const   vg_tid )
10275 {   10356 {
10276   long tmp ;   10357   long tmp ;
10277   DrdThreadId tmp___0 ;   10358   DrdThreadId tmp___0 ;
10278   long tmp___1 ;   10359   long tmp___1 ;
10279   long tmp___2 ;   10360   long tmp___2 ;
10280     10361  
10281   {   10362   {
10282   tmp = __builtin_expect((long )(! (! (vg_tid != 0U))), 1L);   10363   tmp = __builtin_expect((long )(! (! (vg_tid != 0U))), 1L);
10283   if (tmp) {   10364   if (tmp) {
10284     10365  
10285   } else {   10366   } else {
10286     vgPlain_assert_fail((Bool )0,   10367     vgPlain_assert_fail((Bool )0,
10287                         (Char const   *)"vg_tid != VG_INVALID_THREADID",   10368                         (Char const   *)"vg_tid != VG_INVALID_THREADID",
10288                         (Char const   *)"drd_thread.c", 666,   10369                         (Char const   *)"drd_thread.c", 666,
10289                         (Char const   *)"vgDrd_thread_set_vg_running_tid", "");   10370                         (Char const   *)"vgDrd_thread_set_vg_running_tid", "");
10290   }   10371   }
10291   if (vg_tid != (ThreadId const   )s_vg_running_tid) {   10372   if (vg_tid != (ThreadId const   )s_vg_running_tid) {
10292     tmp___0 = vgDrd_VgThreadIdToDrdThreadId(vg_tid);   10373     tmp___0 = vgDrd_VgThreadIdToDrdThreadId(vg_tid);
10293     vgDrd_thread_set_running_tid(vg_tid, (DrdThreadId const   )tmp___0);   10374     vgDrd_thread_set_running_tid(vg_tid, (DrdThreadId const   )tmp___0);
10294   } else {   10375   } else {
10295     10376  
10296   }   10377   }
10297   tmp___1 = __builtin_expect((long )(! (! (s_vg_running_tid != 0U))), 1L);   10378   tmp___1 = __builtin_expect((long )(! (! (s_vg_running_tid != 0U))), 1L);
10298   if (tmp___1) {   10379   if (tmp___1) {
10299     10380  
10300   } else {   10381   } else {
10301     vgPlain_assert_fail((Bool )0,   10382     vgPlain_assert_fail((Bool )0,
10302                         (Char const   *)"s_vg_running_tid != VG_INVALID_THREADID",   10383                         (Char const   *)"s_vg_running_tid != VG_INVALID_THREADID",
10303                         (Char const   *)"drd_thread.c", 674,   10384                         (Char const   *)"drd_thread.c", 674,
10304                         (Char const   *)"vgDrd_thread_set_vg_running_tid", "");   10385                         (Char const   *)"vgDrd_thread_set_vg_running_tid", "");
10305   }   10386   }
10306   tmp___2 = __builtin_expect((long )(! (! (vgDrd_g_drd_running_tid != 0U))), 1L);   10387   tmp___2 = __builtin_expect((long )(! (! (vgDrd_g_drd_running_tid != 0U))), 1L);
10307   if (tmp___2) {   10388   if (tmp___2) {
10308     10389  
10309   } else {   10390   } else {
10310     vgPlain_assert_fail((Bool )0,   10391     vgPlain_assert_fail((Bool )0,
10311                         (Char const   *)"DRD_(g_drd_running_tid) != DRD_INVALID_THREADID",   10392                         (Char const   *)"DRD_(g_drd_running_tid) != DRD_INVALID_THREADID",
10312                         (Char const   *)"drd_thread.c", 675,   10393                         (Char const   *)"drd_thread.c", 675,
10313                         (Char const   *)"vgDrd_thread_set_vg_running_tid", "");   10394                         (Char const   *)"vgDrd_thread_set_vg_running_tid", "");
10314   }   10395   }
10315   return;   10396   return;
10316 }   10397 }
10317 }   10398 }
10318 void vgDrd_thread_set_running_tid(ThreadId const   vg_tid ,   10399 void vgDrd_thread_set_running_tid(ThreadId const   vg_tid ,
10319                                   DrdThreadId const   drd_tid )   10400                                   DrdThreadId const   drd_tid )
10320 {   10401 {
10321   long tmp ;   10402   long tmp ;
10322   long tmp___0 ;   10403   long tmp___0 ;
10323   ULong tmp___1 ;   10404   ULong tmp___1 ;
10324   long tmp___2 ;   10405   long tmp___2 ;
10325   long tmp___3 ;   10406   long tmp___3 ;
10326     10407  
10327   {   10408   {
10328   tmp = __builtin_expect((long )(! (! (vg_tid != 0U))), 1L);   10409   tmp = __builtin_expect((long )(! (! (vg_tid != 0U))), 1L);
10329   if (tmp) {   10410   if (tmp) {
10330     10411  
10331   } else {   10412   } else {
10332     vgPlain_assert_fail((Bool )0,   10413     vgPlain_assert_fail((Bool )0,
10333                         (Char const   *)"vg_tid != VG_INVALID_THREADID",   10414                         (Char const   *)"vg_tid != VG_INVALID_THREADID",
10334                         (Char const   *)"drd_thread.c", 685,   10415                         (Char const   *)"drd_thread.c", 685,
10335                         (Char const   *)"vgDrd_thread_set_running_tid", "");   10416                         (Char const   *)"vgDrd_thread_set_running_tid", "");
10336   }   10417   }
10337   tmp___0 = __builtin_expect((long )(! (! (drd_tid != 0U))), 1L);   10418   tmp___0 = __builtin_expect((long )(! (! (drd_tid != 0U))), 1L);
10338   if (tmp___0) {   10419   if (tmp___0) {
10339     10420  
10340   } else {   10421   } else {
10341     vgPlain_assert_fail((Bool )0,   10422     vgPlain_assert_fail((Bool )0,
10342                         (Char const   *)"drd_tid != DRD_INVALID_THREADID",   10423                         (Char const   *)"drd_tid != DRD_INVALID_THREADID",
10343                         (Char const   *)"drd_thread.c", 686,   10424                         (Char const   *)"drd_thread.c", 686,
10344                         (Char const   *)"vgDrd_thread_set_running_tid", "");   10425                         (Char const   *)"vgDrd_thread_set_running_tid", "");
10345   }   10426   }
10346   if (vg_tid != (ThreadId const   )s_vg_running_tid) {   10427   if (vg_tid != (ThreadId const   )s_vg_running_tid) {
10347     if (s_trace_context_switches) {   10428     if (s_trace_context_switches) {
10348       if (vgDrd_g_drd_running_tid != 0U) {   10429       if (vgDrd_g_drd_running_tid != 0U) {
10349         tmp___1 = vgDrd_sg_get_segments_alive_count();   10430         tmp___1 = vgDrd_sg_get_segments_alive_count();
10350         vgPlain_message((VgMsgKind )2,   10431         vgPlain_message((VgMsgKind )2,
10351                         "Context switch from thread %d to thread %d; segments: %llu\n",   10432                         "Context switch from thread %d to thread %d; segments: %llu\n",
10352                         vgDrd_g_drd_running_tid, drd_tid, tmp___1);   10433                         vgDrd_g_drd_running_tid, drd_tid, tmp___1);
10353       } else {   10434       } else {
10354     10435  
10355       }   10436       }
10356     } else {   10437     } else {
10357     10438  
10358     }   10439     }
10359     s_vg_running_tid = (ThreadId )vg_tid;   10440     s_vg_running_tid = (ThreadId )vg_tid;
10360     vgDrd_g_drd_running_tid = (DrdThreadId )drd_tid;   10441     vgDrd_g_drd_running_tid = (DrdThreadId )drd_tid;
10361     thread_compute_conflict_set(& vgDrd_g_conflict_set, drd_tid);   10442     thread_compute_conflict_set(& vgDrd_g_conflict_set, drd_tid);
10362     s_context_switch_count ++;   10443     s_context_switch_count ++;
10363   } else {   10444   } else {
10364     10445  
10365   }   10446   }
10366   tmp___2 = __builtin_expect((long )(! (! (s_vg_running_tid != 0U))), 1L);   10447   tmp___2 = __builtin_expect((long )(! (! (s_vg_running_tid != 0U))), 1L);
10367   if (tmp___2) {   10448   if (tmp___2) {
10368     10449  
10369   } else {   10450   } else {
10370     vgPlain_assert_fail((Bool )0,   10451     vgPlain_assert_fail((Bool )0,
10371                         (Char const   *)"s_vg_running_tid != VG_INVALID_THREADID",   10452                         (Char const   *)"s_vg_running_tid != VG_INVALID_THREADID",
10372                         (Char const   *)"drd_thread.c", 705,   10453                         (Char const   *)"drd_thread.c", 705,
10373                         (Char const   *)"vgDrd_thread_set_running_tid", "");   10454                         (Char const   *)"vgDrd_thread_set_running_tid", "");
10374   }   10455   }
10375   tmp___3 = __builtin_expect((long )(! (! (vgDrd_g_drd_running_tid != 0U))), 1L);   10456   tmp___3 = __builtin_expect((long )(! (! (vgDrd_g_drd_running_tid != 0U))), 1L);
10376   if (tmp___3) {   10457   if (tmp___3) {
10377     10458  
10378   } else {   10459   } else {
10379     vgPlain_assert_fail((Bool )0,   10460     vgPlain_assert_fail((Bool )0,
10380                         (Char const   *)"DRD_(g_drd_running_tid) != DRD_INVALID_THREADID",   10461                         (Char const   *)"DRD_(g_drd_running_tid) != DRD_INVALID_THREADID",
10381                         (Char const   *)"drd_thread.c", 706,   10462                         (Char const   *)"drd_thread.c", 706,
10382                         (Char const   *)"vgDrd_thread_set_running_tid", "");   10463                         (Char const   *)"vgDrd_thread_set_running_tid", "");
10383   }   10464   }
10384   return;   10465   return;
10385 }   10466 }
10386 }   10467 }
10387 int vgDrd_thread_enter_synchr(DrdThreadId const   tid )   10468 int vgDrd_thread_enter_synchr(DrdThreadId const   tid )
10388 {   10469 {
10389   Bool tmp ;   10470   Bool tmp ;
10390   int tmp___0 ;   10471   int tmp___0 ;
10391   long tmp___1 ;   10472   long tmp___1 ;
10392   Int tmp___2 ;   10473   Int tmp___2 ;
10393     10474  
10394   {   10475   {
10395   tmp = vgDrd_IsValidDrdThreadId(tid);   10476   tmp = vgDrd_IsValidDrdThreadId(tid);
10396   if (tmp) {   10477   if (tmp) {
10397     tmp___0 = 1;   10478     tmp___0 = 1;
10398   } else {   10479   } else {
10399     tmp___0 = 0;   10480     tmp___0 = 0;
10400   }   10481   }
10401   tmp___1 = __builtin_expect((long )tmp___0, 1L);   10482   tmp___1 = __builtin_expect((long )tmp___0, 1L);
10402   if (tmp___1) {   10483   if (tmp___1) {
10403     10484  
10404   } else {   10485   } else {
10405     vgPlain_assert_fail((Bool )0,   10486     vgPlain_assert_fail((Bool )0,
10406                         (Char const   *)"DRD_(IsValidDrdThreadId)(tid)",   10487                         (Char const   *)"DRD_(IsValidDrdThreadId)(tid)",
10407                         (Char const   *)"drd_thread.c", 715,   10488                         (Char const   *)"drd_thread.c", 715,
10408                         (Char const   *)"vgDrd_thread_enter_synchr", "");   10489                         (Char const   *)"vgDrd_thread_enter_synchr", "");
10409   }   10490   }
10410   tmp___2 = vgDrd_g_threadinfo[tid].synchr_nesting;   10491   tmp___2 = vgDrd_g_threadinfo[tid].synchr_nesting;
10411   (vgDrd_g_threadinfo[tid].synchr_nesting) ++;   10492   (vgDrd_g_threadinfo[tid].synchr_nesting) ++;
10412   return (tmp___2);   10493   return (tmp___2);
10413 }   10494 }
10414 }   10495 }
10415 int vgDrd_thread_leave_synchr(DrdThreadId const   tid )   10496 int vgDrd_thread_leave_synchr(DrdThreadId const   tid )
10416 {   10497 {
10417   Bool tmp ;   10498   Bool tmp ;
10418   int tmp___0 ;   10499   int tmp___0 ;
10419   long tmp___1 ;   10500   long tmp___1 ;
10420   long tmp___2 ;   10501   long tmp___2 ;
10421     10502  
10422   {   10503   {
10423   tmp = vgDrd_IsValidDrdThreadId(tid);   10504   tmp = vgDrd_IsValidDrdThreadId(tid);
10424   if (tmp) {   10505   if (tmp) {
10425     tmp___0 = 1;   10506     tmp___0 = 1;
10426   } else {   10507   } else {
10427     tmp___0 = 0;   10508     tmp___0 = 0;
10428   }   10509   }
10429   tmp___1 = __builtin_expect((long )tmp___0, 1L);   10510   tmp___1 = __builtin_expect((long )tmp___0, 1L);
10430   if (tmp___1) {   10511   if (tmp___1) {
10431     10512  
10432   } else {   10513   } else {
10433     vgPlain_assert_fail((Bool )0,   10514     vgPlain_assert_fail((Bool )0,
10434                         (Char const   *)"DRD_(IsValidDrdThreadId)(tid)",   10515                         (Char const   *)"DRD_(IsValidDrdThreadId)(tid)",
10435                         (Char const   *)"drd_thread.c", 725,   10516                         (Char const   *)"drd_thread.c", 725,
10436                         (Char const   *)"vgDrd_thread_leave_synchr", "");   10517                         (Char const   *)"vgDrd_thread_leave_synchr", "");
10437   }   10518   }
10438   tmp___2 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].synchr_nesting >= 1))),   10519   tmp___2 = __builtin_expect((long )(! (! (vgDrd_g_threadinfo[tid].synchr_nesting >= 1))),
10439                              1L);   10520                              1L);
10440   if (tmp___2) {   10521   if (tmp___2) {
10441     10522  
10442   } else {   10523   } else {
10443     vgPlain_assert_fail((Bool )0,   10524     vgPlain_assert_fail((Bool )0,
10444                         (Char const   *)"DRD_(g_threadinfo)[tid].synchr_nesting >= 1",   10525                         (Char const   *)"DRD_(g_threadinfo)[tid].synchr_nesting >= 1",
10445                         (Char const   *)"drd_thread.c", 726,   10526                         (Char const   *)"drd_thread.c", 726,
10446                         (Char const   *)"vgDrd_thread_leave_synchr", "");   10527                         (Char const   *)"vgDrd_thread_leave_synchr", "");
10447   }   10528   }
10448   (vgDrd_g_threadinfo[tid].synchr_nesting) --;   10529   (vgDrd_g_threadinfo[tid].synchr_nesting) --;
10449   return (vgDrd_g_threadinfo[tid].synchr_nesting);   10530   return (vgDrd_g_threadinfo[tid].synchr_nesting);
10450 }   10531 }
10451 }   10532 }
10452 int vgDrd_thread_get_synchr_nesting_count(DrdThreadId const   tid )   10533 int vgDrd_thread_get_synchr_nesting_count(DrdThreadId const   tid )
10453 {   10534 {
10454   Bool tmp ;   10535   Bool tmp ;
10455   int tmp___0 ;   10536   int tmp___0 ;
10456   long tmp___1 ;   10537   long tmp___1 ;
10457     10538  
10458   {   10539   {
10459   tmp = vgDrd_IsValidDrdThreadId(tid);   10540   tmp = vgDrd_IsValidDrdThreadId(tid);
10460   if (tmp) {   10541   if (tmp) {
10461     tmp___0 = 1;   10542     tmp___0 = 1;
10462   } else {   10543   } else {
10463     tmp___0 = 0;   10544     tmp___0 = 0;
10464   }   10545   }
10465   tmp___1 = __builtin_expect((long )tmp___0, 1L);   10546   tmp___1 = __builtin_expect((long )tmp___0, 1L);
10466   if (tmp___1) {   10547   if (tmp___1) {
10467     10548  
10468   } else {   10549   } else {
10469     vgPlain_assert_fail((Bool )0,   10550     vgPlain_assert_fail((Bool )0,
10470                         (Char const   *)"DRD_(IsValidDrdThreadId)(tid)",   10551                         (Char const   *)"DRD_(IsValidDrdThreadId)(tid)",
10471                         (Char const   *)"drd_thread.c", 733,   10552                         (Char const   *)"drd_thread.c", 733,
10472                         (Char const   *)"vgDrd_thread_get_synchr_nesting_count",   10553                         (Char const   *)"vgDrd_thread_get_synchr_nesting_count",
10473                         "");   10554                         "");
10474   }   10555   }
10475   return (vgDrd_g_threadinfo[tid].synchr_nesting);   10556   return (vgDrd_g_threadinfo[tid].synchr_nesting);
10476 }   10557 }
10477 }   10558 }
10478 static void thread_append_segment(DrdThreadId const   tid , Segment * const  sg )   10559 static void thread_append_segment(DrdThreadId const   tid , Segment * const  sg )
10479 {   10560 {
10480   int tmp ;   10561   int tmp ;
10481   long tmp___0 ;   10562   long tmp___0 ;
10482     10563  
10483   {   10564   {
10484   if (0 <= (int )tid) {   10565   if (0 <= (int )tid) {
10485     if (tid < 500U) {   10566     if (tid < 500U) {
10486       if (tid != 0U) {   10567       if (tid != 0U) {
10487         tmp = 1;   10568         tmp = 1;
10488       } else {   10569       } else {
10489         tmp = 0;   10570         tmp = 0;
10490       }   10571       }
10491     } else {   10572     } else {
10492       tmp = 0;   10573       tmp = 0;
10493     }   10574     }
10494   } else {   10575   } else {
10495     tmp = 0;   10576     tmp = 0;
10496   }   10577   }
10497   tmp___0 = __builtin_expect((long )tmp, 1L);   10578   tmp___0 = __builtin_expect((long )tmp, 1L);
10498   if (tmp___0) {   10579   if (tmp___0) {
10499     10580  
10500   } else {   10581   } else {
10501     vgPlain_assert_fail((Bool )0,   10582     vgPlain_assert_fail((Bool )0,
10502                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   10583                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
10503                         (Char const   *)"drd_thread.c", 742,   10584                         (Char const   *)"drd_thread.c", 742,
10504                         (Char const   *)"thread_append_segment", "");   10585                         (Char const   *)"thread_append_segment", "");
10505   }   10586   }
10506   sg->thr_prev = vgDrd_g_threadinfo[tid].sg_last;   10587   sg->thr_prev = vgDrd_g_threadinfo[tid].sg_last;
10507   sg->thr_next = (struct segment *)((void *)0);   10588   sg->thr_next = (struct segment *)((void *)0);
10508   if (vgDrd_g_threadinfo[tid].sg_last) {   10589   if (vgDrd_g_threadinfo[tid].sg_last) {
10509     (vgDrd_g_threadinfo[tid].sg_last)->thr_next = (struct segment *)sg;   10590     (vgDrd_g_threadinfo[tid].sg_last)->thr_next = (struct segment *)sg;
10510   } else {   10591   } else {
10511     10592  
10512   }   10593   }
10513   vgDrd_g_threadinfo[tid].sg_last = (struct segment *)sg;   10594   vgDrd_g_threadinfo[tid].sg_last = (struct segment *)sg;
10514   if ((unsigned int )vgDrd_g_threadinfo[tid].sg_first == (unsigned int )((void *)0)) {   10595   if ((unsigned int )vgDrd_g_threadinfo[tid].sg_first == (unsigned int )((void *)0)) {
10515     vgDrd_g_threadinfo[tid].sg_first = (struct segment *)sg;   10596     vgDrd_g_threadinfo[tid].sg_first = (struct segment *)sg;
10516   } else {   10597   } else {
10517     10598  
10518   }   10599   }
10519   return;   10600   return;
10520 }   10601 }
10521 }   10602 }
10522 static void thread_discard_segment(DrdThreadId const   tid ,   10603 static void thread_discard_segment(DrdThreadId const   tid ,
10523                                    Segment * const  sg )   10604                                    Segment * const  sg )
10524 {   10605 {
10525   int tmp ;   10606   int tmp ;
10526   long tmp___0 ;   10607   long tmp___0 ;
10527     10608  
10528   {   10609   {
10529   if (0 <= (int )tid) {   10610   if (0 <= (int )tid) {
10530     if (tid < 500U) {   10611     if (tid < 500U) {
10531       if (tid != 0U) {   10612       if (tid != 0U) {
10532         tmp = 1;   10613         tmp = 1;
10533       } else {   10614       } else {
10534         tmp = 0;   10615         tmp = 0;
10535       }   10616       }
10536     } else {   10617     } else {
10537       tmp = 0;   10618       tmp = 0;
10538     }   10619     }
10539   } else {   10620   } else {
10540     tmp = 0;   10621     tmp = 0;
10541   }   10622   }
10542   tmp___0 = __builtin_expect((long )tmp, 1L);   10623   tmp___0 = __builtin_expect((long )tmp, 1L);
10543   if (tmp___0) {   10624   if (tmp___0) {
10544     10625  
10545   } else {   10626   } else {
10546     vgPlain_assert_fail((Bool )0,   10627     vgPlain_assert_fail((Bool )0,
10547                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   10628                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
10548                         (Char const   *)"drd_thread.c", 770,   10629                         (Char const   *)"drd_thread.c", 770,
10549                         (Char const   *)"thread_discard_segment", "");   10630                         (Char const   *)"thread_discard_segment", "");
10550   }   10631   }
10551   if (sg->thr_prev) {   10632   if (sg->thr_prev) {
10552     (sg->thr_prev)->thr_next = sg->thr_next;   10633     (sg->thr_prev)->thr_next = sg->thr_next;
10553   } else {   10634   } else {
10554     10635  
10555   }   10636   }
10556   if (sg->thr_next) {   10637   if (sg->thr_next) {
10557     (sg->thr_next)->thr_prev = sg->thr_prev;   10638     (sg->thr_next)->thr_prev = sg->thr_prev;
10558   } else {   10639   } else {
10559     10640  
10560   }   10641   }
10561   if ((unsigned int )sg == (unsigned int )vgDrd_g_threadinfo[tid].sg_first) {   10642   if ((unsigned int )sg == (unsigned int )vgDrd_g_threadinfo[tid].sg_first) {
10562     vgDrd_g_threadinfo[tid].sg_first = sg->thr_next;   10643     vgDrd_g_threadinfo[tid].sg_first = sg->thr_next;
10563   } else {   10644   } else {
10564     10645  
10565   }   10646   }
10566   if ((unsigned int )sg == (unsigned int )vgDrd_g_threadinfo[tid].sg_last) {   10647   if ((unsigned int )sg == (unsigned int )vgDrd_g_threadinfo[tid].sg_last) {
10567     vgDrd_g_threadinfo[tid].sg_last = sg->thr_prev;   10648     vgDrd_g_threadinfo[tid].sg_last = sg->thr_prev;
10568   } else {   10649   } else {
10569     10650  
10570   }   10651   }
10571   vgDrd_sg_put(sg);   10652   vgDrd_sg_put(sg);
10572   return;   10653   return;
10573 }   10654 }
10574 }   10655 }
10575 VectorClock *vgDrd_thread_get_vc(DrdThreadId const   tid )   10656 VectorClock *vgDrd_thread_get_vc(DrdThreadId const   tid )
10576 {   10657 {
10577   Segment *latest_sg ;   10658   Segment *latest_sg ;
10578   int tmp ;   10659   int tmp ;
10579   long tmp___0 ;   10660   long tmp___0 ;
10580   long tmp___1 ;   10661   long tmp___1 ;
10581     10662  
10582   {   10663   {
10583   if (0 <= (int )tid) {   10664   if (0 <= (int )tid) {
10584     if (tid < 500U) {   10665     if (tid < 500U) {
10585       if (tid != 0U) {   10666       if (tid != 0U) {
10586         tmp = 1;   10667         tmp = 1;
10587       } else {   10668       } else {
10588         tmp = 0;   10669         tmp = 0;
10589       }   10670       }
10590     } else {   10671     } else {
10591       tmp = 0;   10672       tmp = 0;
10592     }   10673     }
10593   } else {   10674   } else {
10594     tmp = 0;   10675     tmp = 0;
10595   }   10676   }
10596   tmp___0 = __builtin_expect((long )tmp, 1L);   10677   tmp___0 = __builtin_expect((long )tmp, 1L);
10597   if (tmp___0) {   10678   if (tmp___0) {
10598     10679  
10599   } else {   10680   } else {
10600     vgPlain_assert_fail((Bool )0,   10681     vgPlain_assert_fail((Bool )0,
10601                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   10682                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
10602                         (Char const   *)"drd_thread.c", 800,   10683                         (Char const   *)"drd_thread.c", 800,
10603                         (Char const   *)"vgDrd_thread_get_vc", "");   10684                         (Char const   *)"vgDrd_thread_get_vc", "");
10604   }   10685   }
10605   latest_sg = vgDrd_g_threadinfo[tid].sg_last;   10686   latest_sg = vgDrd_g_threadinfo[tid].sg_last;
10606   tmp___1 = __builtin_expect((long )(! (! latest_sg)), 1L);   10687   tmp___1 = __builtin_expect((long )(! (! latest_sg)), 1L);
10607   if (tmp___1) {   10688   if (tmp___1) {
10608     10689  
10609   } else {   10690   } else {
10610     vgPlain_assert_fail((Bool )0, (Char const   *)"latest_sg",   10691     vgPlain_assert_fail((Bool )0, (Char const   *)"latest_sg",
10611                         (Char const   *)"drd_thread.c", 802,   10692                         (Char const   *)"drd_thread.c", 802,
10612                         (Char const   *)"vgDrd_thread_get_vc", "");   10693                         (Char const   *)"vgDrd_thread_get_vc", "");
10613   }   10694   }
10614   return (& latest_sg->vc);   10695   return (& latest_sg->vc);
10615 }   10696 }
10616 }   10697 }
10617 void vgDrd_thread_get_latest_segment(Segment **sg , DrdThreadId const   tid )   10698 void vgDrd_thread_get_latest_segment(Segment **sg , DrdThreadId const   tid )
10618 {   10699 {
10619   Segment *latest_sg ;   10700   Segment *latest_sg ;
10620   long tmp ;   10701   long tmp ;
10621   int tmp___0 ;   10702   int tmp___0 ;
10622   long tmp___1 ;   10703   long tmp___1 ;
10623   long tmp___2 ;   10704   long tmp___2 ;
10624     10705  
10625   {   10706   {
10626   tmp = __builtin_expect((long )(! (! sg)), 1L);   10707   tmp = __builtin_expect((long )(! (! sg)), 1L);
10627   if (tmp) {   10708   if (tmp) {
10628     10709  
10629   } else {   10710   } else {
10630     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",   10711     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",
10631                         (Char const   *)"drd_thread.c", 813,   10712                         (Char const   *)"drd_thread.c", 813,
10632                         (Char const   *)"vgDrd_thread_get_latest_segment", "");   10713                         (Char const   *)"vgDrd_thread_get_latest_segment", "");
10633   }   10714   }
10634   if (0 <= (int )tid) {   10715   if (0 <= (int )tid) {
10635     if (tid < 500U) {   10716     if (tid < 500U) {
10636       if (tid != 0U) {   10717       if (tid != 0U) {
10637         tmp___0 = 1;   10718         tmp___0 = 1;
10638       } else {   10719       } else {
10639         tmp___0 = 0;   10720         tmp___0 = 0;
10640       }   10721       }
10641     } else {   10722     } else {
10642       tmp___0 = 0;   10723       tmp___0 = 0;
10643     }   10724     }
10644   } else {   10725   } else {
10645     tmp___0 = 0;   10726     tmp___0 = 0;
10646   }   10727   }
10647   tmp___1 = __builtin_expect((long )tmp___0, 1L);   10728   tmp___1 = __builtin_expect((long )tmp___0, 1L);
10648   if (tmp___1) {   10729   if (tmp___1) {
10649     10730  
10650   } else {   10731   } else {
10651     vgPlain_assert_fail((Bool )0,   10732     vgPlain_assert_fail((Bool )0,
10652                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   10733                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
10653                         (Char const   *)"drd_thread.c", 815,   10734                         (Char const   *)"drd_thread.c", 815,
10654                         (Char const   *)"vgDrd_thread_get_latest_segment", "");   10735                         (Char const   *)"vgDrd_thread_get_latest_segment", "");
10655   }   10736   }
10656   latest_sg = vgDrd_g_threadinfo[tid].sg_last;   10737   latest_sg = vgDrd_g_threadinfo[tid].sg_last;
10657   tmp___2 = __builtin_expect((long )(! (! latest_sg)), 1L);   10738   tmp___2 = __builtin_expect((long )(! (! latest_sg)), 1L);
10658   if (tmp___2) {   10739   if (tmp___2) {
10659     10740  
10660   } else {   10741   } else {
10661     vgPlain_assert_fail((Bool )0, (Char const   *)"latest_sg",   10742     vgPlain_assert_fail((Bool )0, (Char const   *)"latest_sg",
10662                         (Char const   *)"drd_thread.c", 817,   10743                         (Char const   *)"drd_thread.c", 817,
10663                         (Char const   *)"vgDrd_thread_get_latest_segment", "");   10744                         (Char const   *)"vgDrd_thread_get_latest_segment", "");
10664   }   10745   }
10665   vgDrd_sg_put((Segment */* const  */)*sg);   10746   vgDrd_sg_put((Segment */* const  */)*sg);
10666   *sg = vgDrd_sg_get((Segment */* const  */)latest_sg);   10747   *sg = vgDrd_sg_get((Segment */* const  */)latest_sg);
10667   return;   10748   return;
10668 }   10749 }
10669 }   10750 }
10670 static void vgDrd_thread_compute_minimum_vc(VectorClock *vc )   10751 static void vgDrd_thread_compute_minimum_vc(VectorClock *vc )
10671 {   10752 {
10672   unsigned int i ;   10753   unsigned int i ;
10673   Bool first ;   10754   Bool first ;
10674   Segment *latest_sg ;   10755   Segment *latest_sg ;
10675     10756  
10676   {   10757   {
10677   first = (Bool )1;   10758   first = (Bool )1;
10678   i = 0U;   10759   i = 0U;
10679   while (i < 500U) {   10760   while (i < 500U) {
10680     latest_sg = vgDrd_g_threadinfo[i].sg_last;   10761     latest_sg = vgDrd_g_threadinfo[i].sg_last;
10681     if (latest_sg) {   10762     if (latest_sg) {
10682       if (first) {   10763       if (first) {
10683         vgDrd_vc_assign((VectorClock */* const  */)vc,   10764         vgDrd_vc_assign((VectorClock */* const  */)vc,
10684                         (VectorClock const   */* const  */)(& latest_sg->vc));   10765                         (VectorClock const   */* const  */)(& latest_sg->vc));
10685       } else {   10766       } else {
10686         vgDrd_vc_min((VectorClock */* const  */)vc,   10767         vgDrd_vc_min((VectorClock */* const  */)vc,
10687                      (VectorClock const   */* const  */)(& latest_sg->vc));   10768                      (VectorClock const   */* const  */)(& latest_sg->vc));
10688       }   10769       }
10689       first = (Bool )0;   10770       first = (Bool )0;
10690     } else {   10771     } else {
10691     10772  
10692     }   10773     }
10693     i ++;   10774     i ++;
10694   }   10775   }
10695   return;   10776   return;
10696 }   10777 }
10697 }   10778 }
10698 static void vgDrd_thread_compute_maximum_vc(VectorClock *vc )   10779 static void vgDrd_thread_compute_maximum_vc(VectorClock *vc )
10699 {   10780 {
10700   unsigned int i ;   10781   unsigned int i ;
10701   Bool first ;   10782   Bool first ;
10702   Segment *latest_sg ;   10783   Segment *latest_sg ;
10703     10784  
10704   {   10785   {
10705   first = (Bool )1;   10786   first = (Bool )1;
10706   i = 0U;   10787   i = 0U;
10707   while (i < 500U) {   10788   while (i < 500U) {
10708     latest_sg = vgDrd_g_threadinfo[i].sg_last;   10789     latest_sg = vgDrd_g_threadinfo[i].sg_last;
10709     if (latest_sg) {   10790     if (latest_sg) {
10710       if (first) {   10791       if (first) {
10711         vgDrd_vc_assign((VectorClock */* const  */)vc,   10792         vgDrd_vc_assign((VectorClock */* const  */)vc,
10712                         (VectorClock const   */* const  */)(& latest_sg->vc));   10793                         (VectorClock const   */* const  */)(& latest_sg->vc));
10713       } else {   10794       } else {
10714         vgDrd_vc_combine((VectorClock */* const  */)vc,   10795         vgDrd_vc_combine((VectorClock */* const  */)vc,
10715                          (VectorClock const   */* const  */)(& latest_sg->vc));   10796                          (VectorClock const   */* const  */)(& latest_sg->vc));
10716       }   10797       }
10717       first = (Bool )0;   10798       first = (Bool )0;
10718     } else {   10799     } else {
10719     10800  
10720     }   10801     }
10721     i ++;   10802     i ++;
10722   }   10803   }
10723   return;   10804   return;
10724 }   10805 }
10725 }   10806 }
10726 static void thread_discard_ordered_segments(void)   10807 static void thread_discard_ordered_segments(void)
10727 {   10808 {
10728   unsigned int i ;   10809   unsigned int i ;
10729   VectorClock thread_vc_min ;   10810   VectorClock thread_vc_min ;
10730   char *vc_min ;   10811   char *vc_min ;
10731   char *vc_max ;   10812   char *vc_max ;
10732   VectorClock thread_vc_max ;   10813   VectorClock thread_vc_max ;
10733   Bool tmp ;   10814   Bool tmp ;
10734   Segment *sg ;   10815   Segment *sg ;
10735   Segment *sg_next ;   10816   Segment *sg_next ;
10736   Bool tmp___0 ;   10817   Bool tmp___0 ;
10737     10818  
10738   {   10819   {
10739   s_discard_ordered_segments_count ++;   10820   s_discard_ordered_segments_count ++;
10740   vgDrd_vc_init((VectorClock */* const  */)(& thread_vc_min),   10821   vgDrd_vc_init((VectorClock */* const  */)(& thread_vc_min),
10741                 (VCElem const   */* const  */)0, (unsigned int const   )0);   10822                 (VCElem const   */* const  */)0, (unsigned int const   )0);
10742   vgDrd_thread_compute_minimum_vc(& thread_vc_min);   10823   vgDrd_thread_compute_minimum_vc(& thread_vc_min);
10743   tmp = vgDrd_sg_get_trace();   10824   tmp = vgDrd_sg_get_trace();
10744   if (tmp) {   10825   if (tmp) {
10745     vgDrd_vc_init((VectorClock */* const  */)(& thread_vc_max),   10826     vgDrd_vc_init((VectorClock */* const  */)(& thread_vc_max),
10746                   (VCElem const   */* const  */)0, (unsigned int const   )0);   10827                   (VCElem const   */* const  */)0, (unsigned int const   )0);
10747     vgDrd_thread_compute_maximum_vc(& thread_vc_max);   10828     vgDrd_thread_compute_maximum_vc(& thread_vc_max);
10748     vc_min = vgDrd_vc_aprint((VectorClock const   */* const  */)(& thread_vc_min));   10829     vc_min = vgDrd_vc_aprint((VectorClock const   */* const  */)(& thread_vc_min));
10749     vc_max = vgDrd_vc_aprint((VectorClock const   */* const  */)(& thread_vc_max));   10830     vc_max = vgDrd_vc_aprint((VectorClock const   */* const  */)(& thread_vc_max));
10750     vgPlain_message((VgMsgKind )2,   10831     vgPlain_message((VgMsgKind )2,
10751                     "Discarding ordered segments -- min vc is %s, max vc is %s\n",   10832                     "Discarding ordered segments -- min vc is %s, max vc is %s\n",
10752                     vc_min, vc_max);   10833                     vc_min, vc_max);
10753     vgPlain_free((void *)vc_min);   10834     vgPlain_free((void *)vc_min);
10754     vgPlain_free((void *)vc_max);   10835     vgPlain_free((void *)vc_max);
10755     vgDrd_vc_cleanup((VectorClock */* const  */)(& thread_vc_max));   10836     vgDrd_vc_cleanup((VectorClock */* const  */)(& thread_vc_max));
10756   } else {   10837   } else {
10757     10838  
10758   }   10839   }
10759   i = 0U;   10840   i = 0U;
10760   while (i < 500U) {   10841   while (i < 500U) {
10761     sg = vgDrd_g_threadinfo[i].sg_first;   10842     sg = vgDrd_g_threadinfo[i].sg_first;
10762     while (1) {   10843     while (1) {
10763       if (sg) {   10844       if (sg) {
10764         sg_next = sg->thr_next;   10845         sg_next = sg->thr_next;
10765         if (sg_next) {   10846         if (sg_next) {
10766           tmp___0 = vgDrd_vc_lte((VectorClock const   */* const  */)(& sg->vc),   10847           tmp___0 = vgDrd_vc_lte((VectorClock const   */* const  */)(& sg->vc),
10767                                  (VectorClock const   */* const  */)(& thread_vc_min));   10848                                  (VectorClock const   */* const  */)(& thread_vc_min));
10768           if (tmp___0) {   10849           if (tmp___0) {
10769     10850  
10770           } else {   10851           } else {
10771             break;   10852             break;
10772           }   10853           }
10773         } else {   10854         } else {
10774           break;   10855           break;
10775         }   10856         }
10776       } else {   10857       } else {
10777         break;   10858         break;
10778       }   10859       }
10779       thread_discard_segment((DrdThreadId const   )i, (Segment */* const  */)sg);   10860       thread_discard_segment((DrdThreadId const   )i, (Segment */* const  */)sg);
10780       sg = sg_next;   10861       sg = sg_next;
10781     }   10862     }
10782     i ++;   10863     i ++;
10783   }   10864   }
10784   vgDrd_vc_cleanup((VectorClock */* const  */)(& thread_vc_min));   10865   vgDrd_vc_cleanup((VectorClock */* const  */)(& thread_vc_min));
10785   return;   10866   return;
10786 }   10867 }
10787 }   10868 }
10788 static Bool thread_consistent_segment_ordering(DrdThreadId const   tid ,   10869 static Bool thread_consistent_segment_ordering(DrdThreadId const   tid ,
10789                                                Segment * const  sg1 ,   10870                                                Segment * const  sg1 ,
10790                                                Segment * const  sg2 )   10871                                                Segment * const  sg2 )
10791 {   10872 {
10792   unsigned int i ;   10873   unsigned int i ;
10793   long tmp ;   10874   long tmp ;
10794   long tmp___0 ;   10875   long tmp___0 ;
10795   long tmp___1 ;   10876   long tmp___1 ;
10796   Bool tmp___2 ;   10877   Bool tmp___2 ;
10797   int tmp___3 ;   10878   int tmp___3 ;
10798   long tmp___4 ;   10879   long tmp___4 ;
10799   Segment *sg ;   10880   Segment *sg ;
10800   Bool tmp___5 ;   10881   Bool tmp___5 ;
10801   Bool tmp___6 ;   10882   Bool tmp___6 ;
10802   int tmp___7 ;   10883   int tmp___7 ;
10803   Bool tmp___8 ;   10884   Bool tmp___8 ;
10804   Bool tmp___9 ;   10885   Bool tmp___9 ;
10805   int tmp___10 ;   10886   int tmp___10 ;
10806     10887  
10807   {   10888   {
10808   tmp = __builtin_expect((long )(! (! sg1->thr_next)), 1L);   10889   tmp = __builtin_expect((long )(! (! sg1->thr_next)), 1L);
10809   if (tmp) {   10890   if (tmp) {
10810     10891  
10811   } else {   10892   } else {
10812     vgPlain_assert_fail((Bool )0, (Char const   *)"sg1->thr_next",   10893     vgPlain_assert_fail((Bool )0, (Char const   *)"sg1->thr_next",
10813                         (Char const   *)"drd_thread.c", 955,   10894                         (Char const   *)"drd_thread.c", 955,
10814                         (Char const   *)"thread_consistent_segment_ordering", "");   10895                         (Char const   *)"thread_consistent_segment_ordering", "");
10815   }   10896   }
10816   tmp___0 = __builtin_expect((long )(! (! sg2->thr_next)), 1L);   10897   tmp___0 = __builtin_expect((long )(! (! sg2->thr_next)), 1L);
10817   if (tmp___0) {   10898   if (tmp___0) {
10818     10899  
10819   } else {   10900   } else {
10820     vgPlain_assert_fail((Bool )0, (Char const   *)"sg2->thr_next",   10901     vgPlain_assert_fail((Bool )0, (Char const   *)"sg2->thr_next",
10821                         (Char const   *)"drd_thread.c", 956,   10902                         (Char const   *)"drd_thread.c", 956,
10822                         (Char const   *)"thread_consistent_segment_ordering", "");   10903                         (Char const   *)"thread_consistent_segment_ordering", "");
10823   }   10904   }
10824   tmp___1 = __builtin_expect((long )(! (! ((unsigned int )sg1->thr_next == (unsigned int )sg2))),   10905   tmp___1 = __builtin_expect((long )(! (! ((unsigned int )sg1->thr_next == (unsigned int )sg2))),
10825                              1L);   10906                              1L);
10826   if (tmp___1) {   10907   if (tmp___1) {
10827     10908  
10828   } else {   10909   } else {
10829     vgPlain_assert_fail((Bool )0, (Char const   *)"sg1->thr_next == sg2",   10910     vgPlain_assert_fail((Bool )0, (Char const   *)"sg1->thr_next == sg2",
10830                         (Char const   *)"drd_thread.c", 957,   10911                         (Char const   *)"drd_thread.c", 957,
10831                         (Char const   *)"thread_consistent_segment_ordering", "");   10912                         (Char const   *)"thread_consistent_segment_ordering", "");
10832   }   10913   }
10833   tmp___2 = vgDrd_vc_lte((VectorClock const   */* const  */)(& sg1->vc),   10914   tmp___2 = vgDrd_vc_lte((VectorClock const   */* const  */)(& sg1->vc),
10834                          (VectorClock const   */* const  */)(& sg2->vc));   10915                          (VectorClock const   */* const  */)(& sg2->vc));
10835   if (tmp___2) {   10916   if (tmp___2) {
10836     tmp___3 = 1;   10917     tmp___3 = 1;
10837   } else {   10918   } else {
10838     tmp___3 = 0;   10919     tmp___3 = 0;
10839   }   10920   }
10840   tmp___4 = __builtin_expect((long )tmp___3, 1L);   10921   tmp___4 = __builtin_expect((long )tmp___3, 1L);
10841   if (tmp___4) {   10922   if (tmp___4) {
10842     10923  
10843   } else {   10924   } else {
10844     vgPlain_assert_fail((Bool )0,   10925     vgPlain_assert_fail((Bool )0,
10845                         (Char const   *)"DRD_(vc_lte)(&sg1->vc, &sg2->vc)",   10926                         (Char const   *)"DRD_(vc_lte)(&sg1->vc, &sg2->vc)",
10846                         (Char const   *)"drd_thread.c", 958,   10927                         (Char const   *)"drd_thread.c", 958,
10847                         (Char const   *)"thread_consistent_segment_ordering", "");   10928                         (Char const   *)"thread_consistent_segment_ordering", "");
10848   }   10929   }
10849   i = 0U;   10930   i = 0U;
10850   while (i < 500U) {   10931   while (i < 500U) {
10851     sg = vgDrd_g_threadinfo[i].sg_first;   10932     sg = vgDrd_g_threadinfo[i].sg_first;
10852     while (sg) {   10933     while (sg) {
10853       if (! sg->thr_next) {   10934       if (! sg->thr_next) {
10854         goto _L;   10935         goto _L;
10855       } else {   10936       } else {
10856         tmp___7 = vgDrd_sg_get_refcnt((Segment const   */* const  */)sg);   10937         tmp___7 = vgDrd_sg_get_refcnt((Segment const   */* const  */)sg);
10857         if (tmp___7 > 1) {   10938         if (tmp___7 > 1) {
10858           _L: /* CIL Label */   10939           _L: /* CIL Label */
10859           tmp___5 = vgDrd_vc_lte((VectorClock const   */* const  */)(& sg2->vc),   10940           tmp___5 = vgDrd_vc_lte((VectorClock const   */* const  */)(& sg2->vc),
10860                                  (VectorClock const   */* const  */)(& sg->vc));   10941                                  (VectorClock const   */* const  */)(& sg->vc));
10861           if (tmp___5) {   10942           if (tmp___5) {
10862             break;   10943             break;
10863           } else {   10944           } else {
10864     10945  
10865           }   10946           }
10866           tmp___6 = vgDrd_vc_lte((VectorClock const   */* const  */)(& sg1->vc),   10947           tmp___6 = vgDrd_vc_lte((VectorClock const   */* const  */)(& sg1->vc),
10867                                  (VectorClock const   */* const  */)(& sg->vc));   10948                                  (VectorClock const   */* const  */)(& sg->vc));
10868           if (tmp___6) {   10949           if (tmp___6) {
10869             return ((Bool )0);   10950             return ((Bool )0);
10870           } else {   10951           } else {
10871     10952  
10872           }   10953           }
10873         } else {   10954         } else {
10874     10955  
10875         }   10956         }
10876       }   10957       }
10877       sg = sg->thr_next;   10958       sg = sg->thr_next;
10878     }   10959     }
10879     sg = vgDrd_g_threadinfo[i].sg_last;   10960     sg = vgDrd_g_threadinfo[i].sg_last;
10880     while (sg) {   10961     while (sg) {
10881       if (! sg->thr_next) {   10962       if (! sg->thr_next) {
10882         goto _L___0;   10963         goto _L___0;
10883       } else {   10964       } else {
10884         tmp___10 = vgDrd_sg_get_refcnt((Segment const   */* const  */)sg);   10965         tmp___10 = vgDrd_sg_get_refcnt((Segment const   */* const  */)sg);
10885         if (tmp___10 > 1) {   10966         if (tmp___10 > 1) {
10886           _L___0: /* CIL Label */   10967           _L___0: /* CIL Label */
10887           tmp___8 = vgDrd_vc_lte((VectorClock const   */* const  */)(& sg->vc),   10968           tmp___8 = vgDrd_vc_lte((VectorClock const   */* const  */)(& sg->vc),
10888                                  (VectorClock const   */* const  */)(& sg1->vc));   10969                                  (VectorClock const   */* const  */)(& sg1->vc));
10889           if (tmp___8) {   10970           if (tmp___8) {
10890             break;   10971             break;
10891           } else {   10972           } else {
10892     10973  
10893           }   10974           }
10894           tmp___9 = vgDrd_vc_lte((VectorClock const   */* const  */)(& sg->vc),   10975           tmp___9 = vgDrd_vc_lte((VectorClock const   */* const  */)(& sg->vc),
10895                                  (VectorClock const   */* const  */)(& sg2->vc));   10976                                  (VectorClock const   */* const  */)(& sg2->vc));
10896           if (tmp___9) {   10977           if (tmp___9) {
10897             return ((Bool )0);   10978             return ((Bool )0);
10898           } else {   10979           } else {
10899     10980  
10900           }   10981           }
10901         } else {   10982         } else {
10902     10983  
10903         }   10984         }
10904       }   10985       }
10905       sg = sg->thr_prev;   10986       sg = sg->thr_prev;
10906     }   10987     }
10907     i ++;   10988     i ++;
10908   }   10989   }
10909   return ((Bool )1);   10990   return ((Bool )1);
10910 }   10991 }
10911 }   10992 }
10912 static void thread_merge_segments(void)   10993 static void thread_merge_segments(void)
10913 {   10994 {
10914   unsigned int i ;   10995   unsigned int i ;
10915   Segment *sg ;   10996   Segment *sg ;
10916   Segment *sg_next ;   10997   Segment *sg_next ;
10917   int tmp ;   10998   int tmp ;
10918   Bool tmp___0 ;   10999   Bool tmp___0 ;
10919   int tmp___1 ;   11000   int tmp___1 ;
10920     11001  
10921   {   11002   {
10922   s_new_segments_since_last_merge = (Bool )0;   11003   s_new_segments_since_last_merge = (Bool )0;
10923   i = 0U;   11004   i = 0U;
10924   while (i < 500U) {   11005   while (i < 500U) {
10925     sg = vgDrd_g_threadinfo[i].sg_first;   11006     sg = vgDrd_g_threadinfo[i].sg_first;
10926     while (sg) {   11007     while (sg) {
10927       tmp___1 = vgDrd_sg_get_refcnt((Segment const   */* const  */)sg);   11008       tmp___1 = vgDrd_sg_get_refcnt((Segment const   */* const  */)sg);
10928       if (tmp___1 == 1) {   11009       if (tmp___1 == 1) {
10929         if (sg->thr_next) {   11010         if (sg->thr_next) {
10930           sg_next = sg->thr_next;   11011           sg_next = sg->thr_next;
10931           tmp = vgDrd_sg_get_refcnt((Segment const   */* const  */)sg_next);   11012           tmp = vgDrd_sg_get_refcnt((Segment const   */* const  */)sg_next);
10932           if (tmp == 1) {   11013           if (tmp == 1) {
10933             if (sg_next->thr_next) {   11014             if (sg_next->thr_next) {
10934               tmp___0 = thread_consistent_segment_ordering((DrdThreadId const   )i,   11015               tmp___0 = thread_consistent_segment_ordering((DrdThreadId const   )i,
10935                                                            (Segment */* const  */)sg,   11016                                                            (Segment */* const  */)sg,
10936                                                            (Segment */* const  */)sg_next);   11017                                                            (Segment */* const  */)sg_next);
10937               if (tmp___0) {   11018               if (tmp___0) {
10938                 vgDrd_sg_merge((Segment */* const  */)sg,   11019                 vgDrd_sg_merge((Segment */* const  */)sg,
10939                                (Segment */* const  */)sg_next);   11020                                (Segment */* const  */)sg_next);
10940                 thread_discard_segment((DrdThreadId const   )i,   11021                 thread_discard_segment((DrdThreadId const   )i,
10941                                        (Segment */* const  */)sg_next);   11022                                        (Segment */* const  */)sg_next);
10942               } else {   11023               } else {
10943     11024  
10944               }   11025               }
10945             } else {   11026             } else {
10946     11027  
10947             }   11028             }
10948           } else {   11029           } else {
10949     11030  
10950           }   11031           }
10951         } else {   11032         } else {
10952     11033  
10953         }   11034         }
10954       } else {   11035       } else {
10955     11036  
10956       }   11037       }
10957       sg = sg->thr_next;   11038       sg = sg->thr_next;
10958     }   11039     }
10959     i ++;   11040     i ++;
10960   }   11041   }
10961   return;   11042   return;
10962 }   11043 }
10963 }   11044 }
10964 void vgDrd_thread_new_segment(DrdThreadId const   tid )   11045 void vgDrd_thread_new_segment(DrdThreadId const   tid )
10965 {   11046 {
10966   Segment *last_sg ;   11047   Segment *last_sg ;
10967   Segment *new_sg ;   11048   Segment *new_sg ;
10968   int tmp ;   11049   int tmp ;
10969   long tmp___0 ;   11050   long tmp___0 ;
10970   Bool tmp___1 ;   11051   Bool tmp___1 ;
10971   int tmp___2 ;   11052   int tmp___2 ;
10972   long tmp___3 ;   11053   long tmp___3 ;
10973   Bool tmp___4 ;   11054   Bool tmp___4 ;
10974   int tmp___5 ;   11055   int tmp___5 ;
10975   long tmp___6 ;   11056   long tmp___6 ;
10976     11057  
10977   {   11058   {
10978   if (0 <= (int )tid) {   11059   if (0 <= (int )tid) {
10979     if (tid < 500U) {   11060     if (tid < 500U) {
10980       if (tid != 0U) {   11061       if (tid != 0U) {
10981         tmp = 1;   11062         tmp = 1;
10982       } else {   11063       } else {
10983         tmp = 0;   11064         tmp = 0;
10984       }   11065       }
10985     } else {   11066     } else {
10986       tmp = 0;   11067       tmp = 0;
10987     }   11068     }
10988   } else {   11069   } else {
10989     tmp = 0;   11070     tmp = 0;
10990   }   11071   }
10991   tmp___0 = __builtin_expect((long )tmp, 1L);   11072   tmp___0 = __builtin_expect((long )tmp, 1L);
10992   if (tmp___0) {   11073   if (tmp___0) {
10993     11074  
10994   } else {   11075   } else {
10995     vgPlain_assert_fail((Bool )0,   11076     vgPlain_assert_fail((Bool )0,
10996                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   11077                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
10997                         (Char const   *)"drd_thread.c", 1047,   11078                         (Char const   *)"drd_thread.c", 1047,
10998                         (Char const   *)"vgDrd_thread_new_segment", "");   11079                         (Char const   *)"vgDrd_thread_new_segment", "");
10999   }   11080   }
11000   tmp___1 = thread_conflict_set_up_to_date((DrdThreadId const   )vgDrd_g_drd_running_tid);   11081   tmp___1 = thread_conflict_set_up_to_date((DrdThreadId const   )vgDrd_g_drd_running_tid);
11001   if (tmp___1) {   11082   if (tmp___1) {
11002     tmp___2 = 1;   11083     tmp___2 = 1;
11003   } else {   11084   } else {
11004     tmp___2 = 0;   11085     tmp___2 = 0;
11005   }   11086   }
11006   tmp___3 = __builtin_expect((long )tmp___2, 1L);   11087   tmp___3 = __builtin_expect((long )tmp___2, 1L);
11007   if (tmp___3) {   11088   if (tmp___3) {
11008     11089  
11009   } else {   11090   } else {
11010     vgPlain_assert_fail((Bool )0,   11091     vgPlain_assert_fail((Bool )0,
11011                         (Char const   *)"thread_conflict_set_up_to_date(DRD_(g_drd_running_tid))",   11092                         (Char const   *)"thread_conflict_set_up_to_date(DRD_(g_drd_running_tid))",
11012                         (Char const   *)"drd_thread.c", 1048,   11093                         (Char const   *)"drd_thread.c", 1048,
11013                         (Char const   *)"vgDrd_thread_new_segment", "");   11094                         (Char const   *)"vgDrd_thread_new_segment", "");
11014   }   11095   }
11015   last_sg = vgDrd_g_threadinfo[tid].sg_last;   11096   last_sg = vgDrd_g_threadinfo[tid].sg_last;
11016   new_sg = vgDrd_sg_new(tid, tid);   11097   new_sg = vgDrd_sg_new(tid, tid);
11017   thread_append_segment(tid, (Segment */* const  */)new_sg);   11098   thread_append_segment(tid, (Segment */* const  */)new_sg);
11018   if (tid == (DrdThreadId const   )vgDrd_g_drd_running_tid) {   11099   if (tid == (DrdThreadId const   )vgDrd_g_drd_running_tid) {
11019     if (last_sg) {   11100     if (last_sg) {
11020       vgDrd_thread_update_conflict_set(tid,   11101       vgDrd_thread_update_conflict_set(tid,
11021                                        (VectorClock const   */* const  */)(& last_sg->vc));   11102                                        (VectorClock const   */* const  */)(& last_sg->vc));
11022       s_update_conflict_set_new_sg_count ++;   11103       s_update_conflict_set_new_sg_count ++;
11023     } else {   11104     } else {
11024     11105  
11025     }   11106     }
11026   } else {   11107   } else {
11027     11108  
11028   }   11109   }
11029   tmp___4 = thread_conflict_set_up_to_date((DrdThreadId const   )vgDrd_g_drd_running_tid);   11110   tmp___4 = thread_conflict_set_up_to_date((DrdThreadId const   )vgDrd_g_drd_running_tid);
11030   if (tmp___4) {   11111   if (tmp___4) {
11031     tmp___5 = 1;   11112     tmp___5 = 1;
11032   } else {   11113   } else {
11033     tmp___5 = 0;   11114     tmp___5 = 0;
11034   }   11115   }
11035   tmp___6 = __builtin_expect((long )tmp___5, 1L);   11116   tmp___6 = __builtin_expect((long )tmp___5, 1L);
11036   if (tmp___6) {   11117   if (tmp___6) {
11037     11118  
11038   } else {   11119   } else {
11039     vgPlain_assert_fail((Bool )0,   11120     vgPlain_assert_fail((Bool )0,
11040                         (Char const   *)"thread_conflict_set_up_to_date(DRD_(g_drd_running_tid))",   11121                         (Char const   *)"thread_conflict_set_up_to_date(DRD_(g_drd_running_tid))",
11041                         (Char const   *)"drd_thread.c", 1059,   11122                         (Char const   *)"drd_thread.c", 1059,
11042                         (Char const   *)"vgDrd_thread_new_segment", "");   11123                         (Char const   *)"vgDrd_thread_new_segment", "");
11043   }   11124   }
11044   if (s_segment_merging) {   11125   if (s_segment_merging) {
11045     s_new_segments_since_last_merge = (Bool )((int )s_new_segments_since_last_merge + 1);   11126     s_new_segments_since_last_merge = (Bool )((int )s_new_segments_since_last_merge + 1);
11046     if ((int )s_new_segments_since_last_merge >= s_segment_merge_interval) {   11127     if ((int )s_new_segments_since_last_merge >= s_segment_merge_interval) {
11047       thread_discard_ordered_segments();   11128       thread_discard_ordered_segments();
11048       thread_merge_segments();   11129       thread_merge_segments();
11049     } else {   11130     } else {
11050     11131  
11051     }   11132     }
11052   } else {   11133   } else {
11053     11134  
11054   }   11135   }
11055   return;   11136   return;
11056 }   11137 }
11057 }   11138 }
11058 void vgDrd_thread_combine_vc_join(DrdThreadId const   joiner ,   11139 void vgDrd_thread_combine_vc_join(DrdThreadId const   joiner ,
11059                                   DrdThreadId const   joinee )   11140                                   DrdThreadId const   joinee )
11060 {   11141 {
11061   long tmp ;   11142   long tmp ;
11062   int tmp___0 ;   11143   int tmp___0 ;
11063   long tmp___1 ;   11144   long tmp___1 ;
11064   int tmp___2 ;   11145   int tmp___2 ;
11065   long tmp___3 ;   11146   long tmp___3 ;
11066   long tmp___4 ;   11147   long tmp___4 ;
11067   long tmp___5 ;   11148   long tmp___5 ;
11068   long tmp___6 ;   11149   long tmp___6 ;
11069   long tmp___7 ;   11150   long tmp___7 ;
11070   char *str1 ;   11151   char *str1 ;
11071   char *str2 ;   11152   char *str2 ;
11072   VectorClock *tmp___8 ;   11153   VectorClock *tmp___8 ;
11073   VectorClock *tmp___9 ;   11154   VectorClock *tmp___9 ;
11074   Bool tmp___10 ;   11155   Bool tmp___10 ;
11075   VectorClock old_vc ;   11156   VectorClock old_vc ;
11076   VectorClock *tmp___11 ;   11157   VectorClock *tmp___11 ;
11077   VectorClock *tmp___12 ;   11158   VectorClock *tmp___12 ;
11078   VectorClock *tmp___13 ;   11159   VectorClock *tmp___13 ;
11079   VectorClock *tmp___14 ;   11160   VectorClock *tmp___14 ;
11080   VectorClock *tmp___15 ;   11161   VectorClock *tmp___15 ;
11081   char *str ;   11162   char *str ;
11082   VectorClock *tmp___16 ;   11163   VectorClock *tmp___16 ;
11083   Bool tmp___17 ;   11164   Bool tmp___17 ;
11084     11165  
11085   {   11166   {
11086   tmp = __builtin_expect((long )(! (! (joiner != joinee))), 1L);   11167   tmp = __builtin_expect((long )(! (! (joiner != joinee))), 1L);
11087   if (tmp) {   11168   if (tmp) {
11088     11169  
11089   } else {   11170   } else {
11090     vgPlain_assert_fail((Bool )0, (Char const   *)"joiner != joinee",   11171     vgPlain_assert_fail((Bool )0, (Char const   *)"joiner != joinee",
11091                         (Char const   *)"drd_thread.c", 1072,   11172                         (Char const   *)"drd_thread.c", 1072,
11092                         (Char const   *)"vgDrd_thread_combine_vc_join", "");   11173                         (Char const   *)"vgDrd_thread_combine_vc_join", "");
11093   }   11174   }
11094   if (0 <= (int )joiner) {   11175   if (0 <= (int )joiner) {
11095     if (joiner < 500U) {   11176     if (joiner < 500U) {
11096       if (joiner != 0U) {   11177       if (joiner != 0U) {
11097         tmp___0 = 1;   11178         tmp___0 = 1;
11098       } else {   11179       } else {
11099         tmp___0 = 0;   11180         tmp___0 = 0;
11100       }   11181       }
11101     } else {   11182     } else {
11102       tmp___0 = 0;   11183       tmp___0 = 0;
11103     }   11184     }
11104   } else {   11185   } else {
11105     tmp___0 = 0;   11186     tmp___0 = 0;
11106   }   11187   }
11107   tmp___1 = __builtin_expect((long )tmp___0, 1L);   11188   tmp___1 = __builtin_expect((long )tmp___0, 1L);
11108   if (tmp___1) {   11189   if (tmp___1) {
11109     11190  
11110   } else {   11191   } else {
11111     vgPlain_assert_fail((Bool )0,   11192     vgPlain_assert_fail((Bool )0,
11112                         (Char const   *)"0 <= (int)joiner && joiner < DRD_N_THREADS && joiner != DRD_INVALID_THREADID",   11193                         (Char const   *)"0 <= (int)joiner && joiner < DRD_N_THREADS && joiner != DRD_INVALID_THREADID",
11113                         (Char const   *)"drd_thread.c", 1074,   11194                         (Char const   *)"drd_thread.c", 1074,
11114                         (Char const   *)"vgDrd_thread_combine_vc_join", "");   11195                         (Char const   *)"vgDrd_thread_combine_vc_join", "");
11115   }   11196   }
11116   if (0 <= (int )joinee) {   11197   if (0 <= (int )joinee) {
11117     if (joinee < 500U) {   11198     if (joinee < 500U) {
11118       if (joinee != 0U) {   11199       if (joinee != 0U) {
11119         tmp___2 = 1;   11200         tmp___2 = 1;
11120       } else {   11201       } else {
11121         tmp___2 = 0;   11202         tmp___2 = 0;
11122       }   11203       }
11123     } else {   11204     } else {
11124       tmp___2 = 0;   11205       tmp___2 = 0;
11125     }   11206     }
11126   } else {   11207   } else {
11127     tmp___2 = 0;   11208     tmp___2 = 0;
11128   }   11209   }
11129   tmp___3 = __builtin_expect((long )tmp___2, 1L);   11210   tmp___3 = __builtin_expect((long )tmp___2, 1L);
11130   if (tmp___3) {   11211   if (tmp___3) {
11131     11212  
11132   } else {   11213   } else {
11133     vgPlain_assert_fail((Bool )0,   11214     vgPlain_assert_fail((Bool )0,
11134                         (Char const   *)"0 <= (int)joinee && joinee < DRD_N_THREADS && joinee != DRD_INVALID_THREADID",   11215                         (Char const   *)"0 <= (int)joinee && joinee < DRD_N_THREADS && joinee != DRD_INVALID_THREADID",
11135                         (Char const   *)"drd_thread.c", 1076,   11216                         (Char const   *)"drd_thread.c", 1076,
11136                         (Char const   *)"vgDrd_thread_combine_vc_join", "");   11217                         (Char const   *)"vgDrd_thread_combine_vc_join", "");
11137   }   11218   }
11138   tmp___4 = __builtin_expect((long )(! (! vgDrd_g_threadinfo[joiner].sg_first)),   11219   tmp___4 = __builtin_expect((long )(! (! vgDrd_g_threadinfo[joiner].sg_first)),
11139                              1L);   11220                              1L);
11140   if (tmp___4) {   11221   if (tmp___4) {
11141     11222  
11142   } else {   11223   } else {
11143     vgPlain_assert_fail((Bool )0,   11224     vgPlain_assert_fail((Bool )0,
11144                         (Char const   *)"DRD_(g_threadinfo)[joiner].sg_first",   11225                         (Char const   *)"DRD_(g_threadinfo)[joiner].sg_first",
11145                         (Char const   *)"drd_thread.c", 1077,   11226                         (Char const   *)"drd_thread.c", 1077,
11146                         (Char const   *)"vgDrd_thread_combine_vc_join", "");   11227                         (Char const   *)"vgDrd_thread_combine_vc_join", "");
11147   }   11228   }
11148   tmp___5 = __builtin_expect((long )(! (! vgDrd_g_threadinfo[joiner].sg_last)),   11229   tmp___5 = __builtin_expect((long )(! (! vgDrd_g_threadinfo[joiner].sg_last)),
11149                              1L);   11230                              1L);
11150   if (tmp___5) {   11231   if (tmp___5) {
11151     11232  
11152   } else {   11233   } else {
11153     vgPlain_assert_fail((Bool )0,   11234     vgPlain_assert_fail((Bool )0,
11154                         (Char const   *)"DRD_(g_threadinfo)[joiner].sg_last",   11235                         (Char const   *)"DRD_(g_threadinfo)[joiner].sg_last",
11155                         (Char const   *)"drd_thread.c", 1078,   11236                         (Char const   *)"drd_thread.c", 1078,
11156                         (Char const   *)"vgDrd_thread_combine_vc_join", "");   11237                         (Char const   *)"vgDrd_thread_combine_vc_join", "");
11157   }   11238   }
11158   tmp___6 = __builtin_expect((long )(! (! vgDrd_g_threadinfo[joinee].sg_first)),   11239   tmp___6 = __builtin_expect((long )(! (! vgDrd_g_threadinfo[joinee].sg_first)),
11159                              1L);   11240                              1L);
11160   if (tmp___6) {   11241   if (tmp___6) {
11161     11242  
11162   } else {   11243   } else {
11163     vgPlain_assert_fail((Bool )0,   11244     vgPlain_assert_fail((Bool )0,
11164                         (Char const   *)"DRD_(g_threadinfo)[joinee].sg_first",   11245                         (Char const   *)"DRD_(g_threadinfo)[joinee].sg_first",
11165                         (Char const   *)"drd_thread.c", 1079,   11246                         (Char const   *)"drd_thread.c", 1079,
11166                         (Char const   *)"vgDrd_thread_combine_vc_join", "");   11247                         (Char const   *)"vgDrd_thread_combine_vc_join", "");
11167   }   11248   }
11168   tmp___7 = __builtin_expect((long )(! (! vgDrd_g_threadinfo[joinee].sg_last)),   11249   tmp___7 = __builtin_expect((long )(! (! vgDrd_g_threadinfo[joinee].sg_last)),
11169                              1L);   11250                              1L);
11170   if (tmp___7) {   11251   if (tmp___7) {
11171     11252  
11172   } else {   11253   } else {
11173     vgPlain_assert_fail((Bool )0,   11254     vgPlain_assert_fail((Bool )0,
11174                         (Char const   *)"DRD_(g_threadinfo)[joinee].sg_last",   11255                         (Char const   *)"DRD_(g_threadinfo)[joinee].sg_last",
11175                         (Char const   *)"drd_thread.c", 1080,   11256                         (Char const   *)"drd_thread.c", 1080,
11176                         (Char const   *)"vgDrd_thread_combine_vc_join", "");   11257                         (Char const   *)"vgDrd_thread_combine_vc_join", "");
11177   }   11258   }
11178   tmp___10 = vgDrd_sg_get_trace();   11259   tmp___10 = vgDrd_sg_get_trace();
11179   if (tmp___10) {   11260   if (tmp___10) {
11180     tmp___8 = vgDrd_thread_get_vc(joiner);   11261     tmp___8 = vgDrd_thread_get_vc(joiner);
11181     str1 = vgDrd_vc_aprint((VectorClock const   */* const  */)tmp___8);   11262     str1 = vgDrd_vc_aprint((VectorClock const   */* const  */)tmp___8);
11182     tmp___9 = vgDrd_thread_get_vc(joinee);   11263     tmp___9 = vgDrd_thread_get_vc(joinee);
11183     str2 = vgDrd_vc_aprint((VectorClock const   */* const  */)tmp___9);   11264     str2 = vgDrd_vc_aprint((VectorClock const   */* const  */)tmp___9);
11184     vgPlain_message((VgMsgKind )2, "Before join: joiner %s, joinee %s\n", str1,   11265     vgPlain_message((VgMsgKind )2, "Before join: joiner %s, joinee %s\n", str1,
11185                     str2);   11266                     str2);
11186     vgPlain_free((void *)str1);   11267     vgPlain_free((void *)str1);
11187     vgPlain_free((void *)str2);   11268     vgPlain_free((void *)str2);
11188   } else {   11269   } else {
11189     11270  
11190   }   11271   }
11191   if (joiner == (DrdThreadId const   )vgDrd_g_drd_running_tid) {   11272   if (joiner == (DrdThreadId const   )vgDrd_g_drd_running_tid) {
11192     tmp___11 = vgDrd_thread_get_vc(joiner);   11273     tmp___11 = vgDrd_thread_get_vc(joiner);
11193     vgDrd_vc_copy((VectorClock */* const  */)(& old_vc),   11274     vgDrd_vc_copy((VectorClock */* const  */)(& old_vc),
11194                   (VectorClock const   */* const  */)tmp___11);   11275                   (VectorClock const   */* const  */)tmp___11);
11195     tmp___12 = vgDrd_thread_get_vc(joinee);   11276     tmp___12 = vgDrd_thread_get_vc(joinee);
11196     tmp___13 = vgDrd_thread_get_vc(joiner);   11277     tmp___13 = vgDrd_thread_get_vc(joiner);
11197     vgDrd_vc_combine((VectorClock */* const  */)tmp___13,   11278     vgDrd_vc_combine((VectorClock */* const  */)tmp___13,
11198                      (VectorClock const   */* const  */)tmp___12);   11279                      (VectorClock const   */* const  */)tmp___12);
11199     vgDrd_thread_update_conflict_set(joiner,   11280     vgDrd_thread_update_conflict_set(joiner,
11200                                      (VectorClock const   */* const  */)(& old_vc));   11281                                      (VectorClock const   */* const  */)(& old_vc));
11201     s_update_conflict_set_join_count ++;   11282     s_update_conflict_set_join_count ++;
11202     vgDrd_vc_cleanup((VectorClock */* const  */)(& old_vc));   11283     vgDrd_vc_cleanup((VectorClock */* const  */)(& old_vc));
11203   } else {   11284   } else {
11204     tmp___14 = vgDrd_thread_get_vc(joinee);   11285     tmp___14 = vgDrd_thread_get_vc(joinee);
11205     tmp___15 = vgDrd_thread_get_vc(joiner);   11286     tmp___15 = vgDrd_thread_get_vc(joiner);
11206     vgDrd_vc_combine((VectorClock */* const  */)tmp___15,   11287     vgDrd_vc_combine((VectorClock */* const  */)tmp___15,
11207                      (VectorClock const   */* const  */)tmp___14);   11288                      (VectorClock const   */* const  */)tmp___14);
11208   }   11289   }
11209   thread_discard_ordered_segments();   11290   thread_discard_ordered_segments();
11210   tmp___17 = vgDrd_sg_get_trace();   11291   tmp___17 = vgDrd_sg_get_trace();
11211   if (tmp___17) {   11292   if (tmp___17) {
11212     tmp___16 = vgDrd_thread_get_vc(joiner);   11293     tmp___16 = vgDrd_thread_get_vc(joiner);
11213     str = vgDrd_vc_aprint((VectorClock const   */* const  */)tmp___16);   11294     str = vgDrd_vc_aprint((VectorClock const   */* const  */)tmp___16);
11214     vgPlain_message((VgMsgKind )2, "After join: %s\n", str);   11295     vgPlain_message((VgMsgKind )2, "After join: %s\n", str);
11215     vgPlain_free((void *)str);   11296     vgPlain_free((void *)str);
11216   } else {   11297   } else {
11217     11298  
11218   }   11299   }
11219   return;   11300   return;
11220 }   11301 }
11221 }   11302 }
11222 static void thread_combine_vc_sync(DrdThreadId tid , Segment const   *sg )   11303 static void thread_combine_vc_sync(DrdThreadId tid , Segment const   *sg )
11223 {   11304 {
11224   VectorClock const   *vc ;   11305   VectorClock const   *vc ;
11225   int tmp ;   11306   int tmp ;
11226   long tmp___0 ;   11307   long tmp___0 ;
11227   long tmp___1 ;   11308   long tmp___1 ;
11228   long tmp___2 ;   11309   long tmp___2 ;
11229   long tmp___3 ;   11310   long tmp___3 ;
11230   long tmp___4 ;   11311   long tmp___4 ;
11231   VectorClock old_vc ;   11312   VectorClock old_vc ;
11232   VectorClock *tmp___5 ;   11313   VectorClock *tmp___5 ;
11233   VectorClock *tmp___6 ;   11314   VectorClock *tmp___6 ;
11234   char *str1 ;   11315   char *str1 ;
11235   char *str2 ;   11316   char *str2 ;
11236   VectorClock *tmp___7 ;   11317   VectorClock *tmp___7 ;
11237   Bool tmp___8 ;   11318   Bool tmp___8 ;
11238   VectorClock *tmp___9 ;   11319   VectorClock *tmp___9 ;
11239   Bool tmp___10 ;   11320   Bool tmp___10 ;
11240   int tmp___11 ;   11321   int tmp___11 ;
11241   long tmp___12 ;   11322   long tmp___12 ;
11242     11323  
11243   {   11324   {
11244   vc = & sg->vc;   11325   vc = & sg->vc;
11245   if (0 <= (int )tid) {   11326   if (0 <= (int )tid) {
11246     if (tid < 500U) {   11327     if (tid < 500U) {
11247       if (tid != 0U) {   11328       if (tid != 0U) {
11248         tmp = 1;   11329         tmp = 1;
11249       } else {   11330       } else {
11250         tmp = 0;   11331         tmp = 0;
11251       }   11332       }
11252     } else {   11333     } else {
11253       tmp = 0;   11334       tmp = 0;
11254     }   11335     }
11255   } else {   11336   } else {
11256     tmp = 0;   11337     tmp = 0;
11257   }   11338   }
11258   tmp___0 = __builtin_expect((long )tmp, 1L);   11339   tmp___0 = __builtin_expect((long )tmp, 1L);
11259   if (tmp___0) {   11340   if (tmp___0) {
11260     11341  
11261   } else {   11342   } else {
11262     vgPlain_assert_fail((Bool )0,   11343     vgPlain_assert_fail((Bool )0,
11263                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   11344                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
11264                         (Char const   *)"drd_thread.c", 1126,   11345                         (Char const   *)"drd_thread.c", 1126,
11265                         (Char const   *)"thread_combine_vc_sync", "");   11346                         (Char const   *)"thread_combine_vc_sync", "");
11266   }   11347   }
11267   tmp___1 = __builtin_expect((long )(! (! vgDrd_g_threadinfo[tid].sg_first)), 1L);   11348   tmp___1 = __builtin_expect((long )(! (! vgDrd_g_threadinfo[tid].sg_first)), 1L);
11268   if (tmp___1) {   11349   if (tmp___1) {
11269     11350  
11270   } else {   11351   } else {
11271     vgPlain_assert_fail((Bool )0,   11352     vgPlain_assert_fail((Bool )0,
11272                         (Char const   *)"DRD_(g_threadinfo)[tid].sg_first",   11353                         (Char const   *)"DRD_(g_threadinfo)[tid].sg_first",
11273                         (Char const   *)"drd_thread.c", 1127,   11354                         (Char const   *)"drd_thread.c", 1127,
11274                         (Char const   *)"thread_combine_vc_sync", "");   11355                         (Char const   *)"thread_combine_vc_sync", "");
11275   }   11356   }
11276   tmp___2 = __builtin_expect((long )(! (! vgDrd_g_threadinfo[tid].sg_last)), 1L);   11357   tmp___2 = __builtin_expect((long )(! (! vgDrd_g_threadinfo[tid].sg_last)), 1L);
11277   if (tmp___2) {   11358   if (tmp___2) {
11278     11359  
11279   } else {   11360   } else {
11280     vgPlain_assert_fail((Bool )0,   11361     vgPlain_assert_fail((Bool )0,
11281                         (Char const   *)"DRD_(g_threadinfo)[tid].sg_last",   11362                         (Char const   *)"DRD_(g_threadinfo)[tid].sg_last",
11282                         (Char const   *)"drd_thread.c", 1128,   11363                         (Char const   *)"drd_thread.c", 1128,
11283                         (Char const   *)"thread_combine_vc_sync", "");   11364                         (Char const   *)"thread_combine_vc_sync", "");
11284   }   11365   }
11285   tmp___3 = __builtin_expect((long )(! (! sg)), 1L);   11366   tmp___3 = __builtin_expect((long )(! (! sg)), 1L);
11286   if (tmp___3) {   11367   if (tmp___3) {
11287     11368  
11288   } else {   11369   } else {
11289     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",   11370     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",
11290                         (Char const   *)"drd_thread.c", 1129,   11371                         (Char const   *)"drd_thread.c", 1129,
11291                         (Char const   *)"thread_combine_vc_sync", "");   11372                         (Char const   *)"thread_combine_vc_sync", "");
11292   }   11373   }
11293   tmp___4 = __builtin_expect((long )(! (! vc)), 1L);   11374   tmp___4 = __builtin_expect((long )(! (! vc)), 1L);
11294   if (tmp___4) {   11375   if (tmp___4) {
11295     11376  
11296   } else {   11377   } else {
11297     vgPlain_assert_fail((Bool )0, (Char const   *)"vc",   11378     vgPlain_assert_fail((Bool )0, (Char const   *)"vc",
11298                         (Char const   *)"drd_thread.c", 1130,   11379                         (Char const   *)"drd_thread.c", 1130,
11299                         (Char const   *)"thread_combine_vc_sync", "");   11380                         (Char const   *)"thread_combine_vc_sync", "");
11300   }   11381   }
11301   if (tid != (DrdThreadId )sg->tid) {   11382   if (tid != (DrdThreadId )sg->tid) {
11302     tmp___5 = vgDrd_thread_get_vc((DrdThreadId const   )tid);   11383     tmp___5 = vgDrd_thread_get_vc((DrdThreadId const   )tid);
11303     vgDrd_vc_copy((VectorClock */* const  */)(& old_vc),   11384     vgDrd_vc_copy((VectorClock */* const  */)(& old_vc),
11304                   (VectorClock const   */* const  */)tmp___5);   11385                   (VectorClock const   */* const  */)tmp___5);
11305     tmp___6 = vgDrd_thread_get_vc((DrdThreadId const   )tid);   11386     tmp___6 = vgDrd_thread_get_vc((DrdThreadId const   )tid);
11306     vgDrd_vc_combine((VectorClock */* const  */)tmp___6,   11387     vgDrd_vc_combine((VectorClock */* const  */)tmp___6,
11307                      (VectorClock const   */* const  */)vc);   11388                      (VectorClock const   */* const  */)vc);
11308     tmp___8 = vgDrd_sg_get_trace();   11389     tmp___8 = vgDrd_sg_get_trace();
11309     if (tmp___8) {   11390     if (tmp___8) {
11310       str1 = vgDrd_vc_aprint((VectorClock const   */* const  */)(& old_vc));   11391       str1 = vgDrd_vc_aprint((VectorClock const   */* const  */)(& old_vc));
11311       tmp___7 = vgDrd_thread_get_vc((DrdThreadId const   )tid);   11392       tmp___7 = vgDrd_thread_get_vc((DrdThreadId const   )tid);
11312       str2 = vgDrd_vc_aprint((VectorClock const   */* const  */)tmp___7);   11393       str2 = vgDrd_vc_aprint((VectorClock const   */* const  */)tmp___7);
11313       vgPlain_message((VgMsgKind )2, "thread %d: vc %s -> %s\n", tid, str1, str2);   11394       vgPlain_message((VgMsgKind )2, "thread %d: vc %s -> %s\n", tid, str1, str2);
11314       vgPlain_free((void *)str1);   11395       vgPlain_free((void *)str1);
11315       vgPlain_free((void *)str2);   11396       vgPlain_free((void *)str2);
11316     } else {   11397     } else {
11317     11398  
11318     }   11399     }
11319     thread_discard_ordered_segments();   11400     thread_discard_ordered_segments();
11320     vgDrd_thread_update_conflict_set((DrdThreadId const   )tid,   11401     vgDrd_thread_update_conflict_set((DrdThreadId const   )tid,
11321                                      (VectorClock const   */* const  */)(& old_vc));   11402                                      (VectorClock const   */* const  */)(& old_vc));
11322     s_update_conflict_set_sync_count ++;   11403     s_update_conflict_set_sync_count ++;
11323     vgDrd_vc_cleanup((VectorClock */* const  */)(& old_vc));   11404     vgDrd_vc_cleanup((VectorClock */* const  */)(& old_vc));
11324   } else {   11405   } else {
11325     tmp___9 = vgDrd_thread_get_vc((DrdThreadId const   )tid);   11406     tmp___9 = vgDrd_thread_get_vc((DrdThreadId const   )tid);
11326     tmp___10 = vgDrd_vc_lte((VectorClock const   */* const  */)vc,   11407     tmp___10 = vgDrd_vc_lte((VectorClock const   */* const  */)vc,
11327                             (VectorClock const   */* const  */)tmp___9);   11408                             (VectorClock const   */* const  */)tmp___9);
11328     if (tmp___10) {   11409     if (tmp___10) {
11329       tmp___11 = 1;   11410       tmp___11 = 1;
11330     } else {   11411     } else {
11331       tmp___11 = 0;   11412       tmp___11 = 0;
11332     }   11413     }
11333     tmp___12 = __builtin_expect((long )tmp___11, 1L);   11414     tmp___12 = __builtin_expect((long )tmp___11, 1L);
11334     if (tmp___12) {   11415     if (tmp___12) {
11335     11416  
11336     } else {   11417     } else {
11337       vgPlain_assert_fail((Bool )0,   11418       vgPlain_assert_fail((Bool )0,
11338                           (Char const   *)"DRD_(vc_lte)(vc, DRD_(thread_get_vc)(tid))",   11419                           (Char const   *)"DRD_(vc_lte)(vc, DRD_(thread_get_vc)(tid))",
11339                           (Char const   *)"drd_thread.c", 1153,   11420                           (Char const   *)"drd_thread.c", 1153,
11340                           (Char const   *)"thread_combine_vc_sync", "");   11421                           (Char const   *)"thread_combine_vc_sync", "");
11341     }   11422     }
11342   }   11423   }
11343   return;   11424   return;
11344 }   11425 }
11345 }   11426 }
11346 void vgDrd_thread_new_segment_and_combine_vc(DrdThreadId tid ,   11427 void vgDrd_thread_new_segment_and_combine_vc(DrdThreadId tid ,
11347                                              Segment const   *sg )   11428                                              Segment const   *sg )
11348 {   11429 {
11349   int tmp ;   11430   int tmp ;
11350   long tmp___0 ;   11431   long tmp___0 ;
11351   Bool tmp___1 ;   11432   Bool tmp___1 ;
11352   int tmp___2 ;   11433   int tmp___2 ;
11353   long tmp___3 ;   11434   long tmp___3 ;
11354   long tmp___4 ;   11435   long tmp___4 ;
11355   Segment *tmp___5 ;   11436   Segment *tmp___5 ;
11356     11437  
11357   {   11438   {
11358   if (0 <= (int )tid) {   11439   if (0 <= (int )tid) {
11359     if (tid < 500U) {   11440     if (tid < 500U) {
11360       if (tid != 0U) {   11441       if (tid != 0U) {
11361         tmp = 1;   11442         tmp = 1;
11362       } else {   11443       } else {
11363         tmp = 0;   11444         tmp = 0;
11364       }   11445       }
11365     } else {   11446     } else {
11366       tmp = 0;   11447       tmp = 0;
11367     }   11448     }
11368   } else {   11449   } else {
11369     tmp = 0;   11450     tmp = 0;
11370   }   11451   }
11371   tmp___0 = __builtin_expect((long )tmp, 1L);   11452   tmp___0 = __builtin_expect((long )tmp, 1L);
11372   if (tmp___0) {   11453   if (tmp___0) {
11373     11454  
11374   } else {   11455   } else {
11375     vgPlain_assert_fail((Bool )0,   11456     vgPlain_assert_fail((Bool )0,
11376                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   11457                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
11377                         (Char const   *)"drd_thread.c", 1166,   11458                         (Char const   *)"drd_thread.c", 1166,
11378                         (Char const   *)"vgDrd_thread_new_segment_and_combine_vc",   11459                         (Char const   *)"vgDrd_thread_new_segment_and_combine_vc",
11379                         "");   11460                         "");
11380   }   11461   }
11381   tmp___1 = thread_conflict_set_up_to_date((DrdThreadId const   )vgDrd_g_drd_running_tid);   11462   tmp___1 = thread_conflict_set_up_to_date((DrdThreadId const   )vgDrd_g_drd_running_tid);
11382   if (tmp___1) {   11463   if (tmp___1) {
11383     tmp___2 = 1;   11464     tmp___2 = 1;
11384   } else {   11465   } else {
11385     tmp___2 = 0;   11466     tmp___2 = 0;
11386   }   11467   }
11387   tmp___3 = __builtin_expect((long )tmp___2, 1L);   11468   tmp___3 = __builtin_expect((long )tmp___2, 1L);
11388   if (tmp___3) {   11469   if (tmp___3) {
11389     11470  
11390   } else {   11471   } else {
11391     vgPlain_assert_fail((Bool )0,   11472     vgPlain_assert_fail((Bool )0,
11392                         (Char const   *)"thread_conflict_set_up_to_date(DRD_(g_drd_running_tid))",   11473                         (Char const   *)"thread_conflict_set_up_to_date(DRD_(g_drd_running_tid))",
11393                         (Char const   *)"drd_thread.c", 1167,   11474                         (Char const   *)"drd_thread.c", 1167,
11394                         (Char const   *)"vgDrd_thread_new_segment_and_combine_vc",   11475                         (Char const   *)"vgDrd_thread_new_segment_and_combine_vc",
11395                         "");   11476                         "");
11396   }   11477   }
11397   tmp___4 = __builtin_expect((long )(! (! sg)), 1L);   11478   tmp___4 = __builtin_expect((long )(! (! sg)), 1L);
11398   if (tmp___4) {   11479   if (tmp___4) {
11399     11480  
11400   } else {   11481   } else {
11401     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",   11482     vgPlain_assert_fail((Bool )0, (Char const   *)"sg",
11402                         (Char const   *)"drd_thread.c", 1168,   11483                         (Char const   *)"drd_thread.c", 1168,
11403                         (Char const   *)"vgDrd_thread_new_segment_and_combine_vc",   11484                         (Char const   *)"vgDrd_thread_new_segment_and_combine_vc",
11404                         "");   11485                         "");
11405   }   11486   }
11406   tmp___5 = vgDrd_sg_new((DrdThreadId const   )tid, (DrdThreadId const   )tid);   11487   tmp___5 = vgDrd_sg_new((DrdThreadId const   )tid, (DrdThreadId const   )tid);
11407   thread_append_segment((DrdThreadId const   )tid,   11488   thread_append_segment((DrdThreadId const   )tid,
11408                         (Segment */* const  */)tmp___5);   11489                         (Segment */* const  */)tmp___5);
11409   thread_combine_vc_sync(tid, sg);   11490   thread_combine_vc_sync(tid, sg);
11410   if (s_segment_merging) {   11491   if (s_segment_merging) {
11411     s_new_segments_since_last_merge = (Bool )((int )s_new_segments_since_last_merge + 1);   11492     s_new_segments_since_last_merge = (Bool )((int )s_new_segments_since_last_merge + 1);
11412     if ((int )s_new_segments_since_last_merge >= s_segment_merge_interval) {   11493     if ((int )s_new_segments_since_last_merge >= s_segment_merge_interval) {
11413       thread_discard_ordered_segments();   11494       thread_discard_ordered_segments();
11414       thread_merge_segments();   11495       thread_merge_segments();
11415     } else {   11496     } else {
11416     11497  
11417     }   11498     }
11418   } else {   11499   } else {
11419     11500  
11420   }   11501   }
11421   return;   11502   return;
11422 }   11503 }
11423 }   11504 }
11424 void vgDrd_thread_stop_using_mem(Addr const   a1 , Addr const   a2 )   11505 void vgDrd_thread_stop_using_mem(Addr const   a1 , Addr const   a2 )
11425 {   11506 {
11426   Segment *p ;   11507   Segment *p ;
11427   struct bitmap *tmp ;   11508   struct bitmap *tmp ;
11428     11509  
11429   {   11510   {
11430   p = vgDrd_g_sg_list;   11511   p = vgDrd_g_sg_list;
11431   while (p) {   11512   while (p) {
11432     tmp = vgDrd_sg_bm((Segment */* const  */)p);   11513     tmp = vgDrd_sg_bm((Segment */* const  */)p);
11433     vgDrd_bm_clear((struct bitmap */* const  */)tmp, a1, a2);   11514     vgDrd_bm_clear((struct bitmap */* const  */)tmp, a1, a2);
11434     p = p->g_next;   11515     p = p->g_next;
11435   }   11516   }
11436   vgDrd_bm_clear((struct bitmap */* const  */)vgDrd_g_conflict_set, a1, a2);   11517   vgDrd_bm_clear((struct bitmap */* const  */)vgDrd_g_conflict_set, a1, a2);
11437   return;   11518   return;
11438 }   11519 }
11439 }   11520 }
11440 void vgDrd_thread_set_record_loads(DrdThreadId const   tid ,   11521 void vgDrd_thread_set_record_loads(DrdThreadId const   tid ,
11441                                    Bool const   enabled )   11522                                    Bool const   enabled )
11442 {   11523 {
11443   int tmp ;   11524   int tmp ;
11444   long tmp___0 ;   11525   long tmp___0 ;
11445   long tmp___1 ;   11526   long tmp___1 ;
11446     11527  
11447   {   11528   {
11448   if (0 <= (int )tid) {   11529   if (0 <= (int )tid) {
11449     if (tid < 500U) {   11530     if (tid < 500U) {
11450       if (tid != 0U) {   11531       if (tid != 0U) {
11451         tmp = 1;   11532         tmp = 1;
11452       } else {   11533       } else {
11453         tmp = 0;   11534         tmp = 0;
11454       }   11535       }
11455     } else {   11536     } else {
11456       tmp = 0;   11537       tmp = 0;
11457     }   11538     }
11458   } else {   11539   } else {
11459     tmp = 0;   11540     tmp = 0;
11460   }   11541   }
11461   tmp___0 = __builtin_expect((long )tmp, 1L);   11542   tmp___0 = __builtin_expect((long )tmp, 1L);
11462   if (tmp___0) {   11543   if (tmp___0) {
11463     11544  
11464   } else {   11545   } else {
11465     vgPlain_assert_fail((Bool )0,   11546     vgPlain_assert_fail((Bool )0,
11466                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   11547                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
11467                         (Char const   *)"drd_thread.c", 1201,   11548                         (Char const   *)"drd_thread.c", 1201,
11468                         (Char const   *)"vgDrd_thread_set_record_loads", "");   11549                         (Char const   *)"vgDrd_thread_set_record_loads", "");
11469   }   11550   }
11470   tmp___1 = __builtin_expect((long )(! (! ((int const   )enabled == (int const   )(! (! enabled))))),   11551   tmp___1 = __builtin_expect((long )(! (! ((int const   )enabled == (int const   )(! (! enabled))))),
11471                              1L);   11552                              1L);
11472   if (tmp___1) {   11553   if (tmp___1) {
11473     11554  
11474   } else {   11555   } else {
11475     vgPlain_assert_fail((Bool )0, (Char const   *)"enabled == !! enabled",   11556     vgPlain_assert_fail((Bool )0, (Char const   *)"enabled == !! enabled",
11476                         (Char const   *)"drd_thread.c", 1202,   11557                         (Char const   *)"drd_thread.c", 1202,
11477                         (Char const   *)"vgDrd_thread_set_record_loads", "");   11558                         (Char const   *)"vgDrd_thread_set_record_loads", "");
11478   }   11559   }
11479   vgDrd_g_threadinfo[tid].is_recording_loads = (Bool )enabled;   11560   vgDrd_g_threadinfo[tid].is_recording_loads = (Bool )enabled;
11480   return;   11561   return;
11481 }   11562 }
11482 }   11563 }
11483 void vgDrd_thread_set_record_stores(DrdThreadId const   tid ,   11564 void vgDrd_thread_set_record_stores(DrdThreadId const   tid ,
11484                                     Bool const   enabled )   11565                                     Bool const   enabled )
11485 {   11566 {
11486   int tmp ;   11567   int tmp ;
11487   long tmp___0 ;   11568   long tmp___0 ;
11488   long tmp___1 ;   11569   long tmp___1 ;
11489     11570  
11490   {   11571   {
11491   if (0 <= (int )tid) {   11572   if (0 <= (int )tid) {
11492     if (tid < 500U) {   11573     if (tid < 500U) {
11493       if (tid != 0U) {   11574       if (tid != 0U) {
11494         tmp = 1;   11575         tmp = 1;
11495       } else {   11576       } else {
11496         tmp = 0;   11577         tmp = 0;
11497       }   11578       }
11498     } else {   11579     } else {
11499       tmp = 0;   11580       tmp = 0;
11500     }   11581     }
11501   } else {   11582   } else {
11502     tmp = 0;   11583     tmp = 0;
11503   }   11584   }
11504   tmp___0 = __builtin_expect((long )tmp, 1L);   11585   tmp___0 = __builtin_expect((long )tmp, 1L);
11505   if (tmp___0) {   11586   if (tmp___0) {
11506     11587  
11507   } else {   11588   } else {
11508     vgPlain_assert_fail((Bool )0,   11589     vgPlain_assert_fail((Bool )0,
11509                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   11590                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
11510                         (Char const   *)"drd_thread.c", 1211,   11591                         (Char const   *)"drd_thread.c", 1211,
11511                         (Char const   *)"vgDrd_thread_set_record_stores", "");   11592                         (Char const   *)"vgDrd_thread_set_record_stores", "");
11512   }   11593   }
11513   tmp___1 = __builtin_expect((long )(! (! ((int const   )enabled == (int const   )(! (! enabled))))),   11594   tmp___1 = __builtin_expect((long )(! (! ((int const   )enabled == (int const   )(! (! enabled))))),
11514                              1L);   11595                              1L);
11515   if (tmp___1) {   11596   if (tmp___1) {
11516     11597  
11517   } else {   11598   } else {
11518     vgPlain_assert_fail((Bool )0, (Char const   *)"enabled == !! enabled",   11599     vgPlain_assert_fail((Bool )0, (Char const   *)"enabled == !! enabled",
11519                         (Char const   *)"drd_thread.c", 1212,   11600                         (Char const   *)"drd_thread.c", 1212,
11520                         (Char const   *)"vgDrd_thread_set_record_stores", "");   11601                         (Char const   *)"vgDrd_thread_set_record_stores", "");
11521   }   11602   }
11522   vgDrd_g_threadinfo[tid].is_recording_stores = (Bool )enabled;   11603   vgDrd_g_threadinfo[tid].is_recording_stores = (Bool )enabled;
11523   return;   11604   return;
11524 }   11605 }
11525 }   11606 }
11526 void vgDrd_thread_print_all(void)   11607 void vgDrd_thread_print_all(void)
11527 {   11608 {
11528   unsigned int i ;   11609   unsigned int i ;
11529   Segment *p ;   11610   Segment *p ;
11530     11611  
11531   {   11612   {
11532   i = 0U;   11613   i = 0U;
11533   while (i < 500U) {   11614   while (i < 500U) {
11534     p = vgDrd_g_threadinfo[i].sg_first;   11615     p = vgDrd_g_threadinfo[i].sg_first;
11535     if (p) {   11616     if (p) {
11536       vgPlain_printf("**************\n* thread %3d (%d/%d/%d/%d/0x%lx/%d) *\n**************\n",   11617       vgPlain_printf("**************\n* thread %3d (%d/%d/%d/%d/0x%lx/%d) *\n**************\n",
11537                      i, (int )vgDrd_g_threadinfo[i].valid,   11618                      i, (int )vgDrd_g_threadinfo[i].valid,
11538                      (int )vgDrd_g_threadinfo[i].vg_thread_exists,   11619                      (int )vgDrd_g_threadinfo[i].vg_thread_exists,
11539                      vgDrd_g_threadinfo[i].vg_threadid,   11620                      vgDrd_g_threadinfo[i].vg_threadid,
11540                      (int )vgDrd_g_threadinfo[i].posix_thread_exists,   11621                      (int )vgDrd_g_threadinfo[i].posix_thread_exists,
11541                      vgDrd_g_threadinfo[i].pt_threadid,   11622                      vgDrd_g_threadinfo[i].pt_threadid,
11542                      (int )vgDrd_g_threadinfo[i].detached_posix_thread);   11623                      (int )vgDrd_g_threadinfo[i].detached_posix_thread);
11543       while (p) {   11624       while (p) {
11544         vgDrd_sg_print((Segment */* const  */)p);   11625         vgDrd_sg_print((Segment */* const  */)p);
11545         p = p->thr_next;   11626         p = p->thr_next;
11546       }   11627       }
11547     } else {   11628     } else {
11548     11629  
11549     }   11630     }
11550     i ++;   11631     i ++;
11551   }   11632   }
11552   return;   11633   return;
11553 }   11634 }
11554 }   11635 }
11555 static void show_call_stack(DrdThreadId const   tid ,   11636 static void show_call_stack(DrdThreadId const   tid ,
11556                             ExeContext * const  callstack )   11637                             ExeContext * const  callstack )
11557 {   11638 {
11558   ThreadId vg_tid ;   11639   ThreadId vg_tid ;
11559   ThreadId tmp ;   11640   ThreadId tmp ;
11560     11641  
11561   {   11642   {
11562   tmp = vgDrd_DrdThreadIdToVgThreadId(tid);   11643   tmp = vgDrd_DrdThreadIdToVgThreadId(tid);
11563   vg_tid = tmp;   11644   vg_tid = tmp;
11564   if (vg_tid != 0U) {   11645   if (vg_tid != 0U) {
11565     if (callstack) {   11646     if (callstack) {
11566       vgPlain_pp_ExeContext((ExeContext *)callstack);   11647       vgPlain_pp_ExeContext((ExeContext *)callstack);
11567     } else {   11648     } else {
11568       vgPlain_get_and_pp_StackTrace(vg_tid, (UInt )vgPlain_clo_backtrace_size);   11649       vgPlain_get_and_pp_StackTrace(vg_tid, (UInt )vgPlain_clo_backtrace_size);
11569     }   11650     }
11570   } else   11651   } else
11571   if (! vgPlain_clo_xml) {   11652   if (! vgPlain_clo_xml) {
11572     vgPlain_message((VgMsgKind )1,   11653     vgPlain_message((VgMsgKind )1,
11573                     "   (thread finished, call stack no longer available)\n");   11654                     "   (thread finished, call stack no longer available)\n");
11574   } else {   11655   } else {
11575     11656  
11576   }   11657   }
11577   return;   11658   return;
11578 }   11659 }
11579 }   11660 }
11580 static void thread_report_conflicting_segments_segment(DrdThreadId const   tid ,   11661 static void thread_report_conflicting_segments_segment(DrdThreadId const   tid ,
11581                                                        Addr const   addr ,   11662                                                        Addr const   addr ,
11582                                                        SizeT const   size ,   11663                                                        SizeT const   size ,
11583                                                        BmAccessTypeT const   access_type ,   11664                                                        BmAccessTypeT const   access_type ,
11584                                                        Segment const   * const  p )   11665                                                        Segment const   * const  p )
11585 {   11666 {
11586   unsigned int i ;   11667   unsigned int i ;
11587   int tmp ;   11668   int tmp ;
11588   long tmp___0 ;   11669   long tmp___0 ;
11589   long tmp___1 ;   11670   long tmp___1 ;
11590   Segment *q ;   11671   Segment *q ;
11591   Bool tmp___2 ;   11672   Bool tmp___2 ;
11592   Segment *q_next ;   11673   Segment *q_next ;
11593   long tmp___3 ;   11674   long tmp___3 ;
11594   ExeContext *tmp___4 ;   11675   ExeContext *tmp___4 ;
11595   struct bitmap *tmp___5 ;   11676   struct bitmap *tmp___5 ;
11596   Bool tmp___6 ;   11677   Bool tmp___6 ;
11597   Bool tmp___7 ;   11678   Bool tmp___7 ;
11598     11679  
11599   {   11680   {
11600   if (0 <= (int )tid) {   11681   if (0 <= (int )tid) {
11601     if (tid < 500U) {   11682     if (tid < 500U) {
11602       if (tid != 0U) {   11683       if (tid != 0U) {
11603         tmp = 1;   11684         tmp = 1;
11604       } else {   11685       } else {
11605         tmp = 0;   11686         tmp = 0;
11606       }   11687       }
11607     } else {   11688     } else {
11608       tmp = 0;   11689       tmp = 0;
11609     }   11690     }
11610   } else {   11691   } else {
11611     tmp = 0;   11692     tmp = 0;
11612   }   11693   }
11613   tmp___0 = __builtin_expect((long )tmp, 1L);   11694   tmp___0 = __builtin_expect((long )tmp, 1L);
11614   if (tmp___0) {   11695   if (tmp___0) {
11615     11696  
11616   } else {   11697   } else {
11617     vgPlain_assert_fail((Bool )0,   11698     vgPlain_assert_fail((Bool )0,
11618                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   11699                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
11619                         (Char const   *)"drd_thread.c", 1275,   11700                         (Char const   *)"drd_thread.c", 1275,
11620                         (Char const   *)"thread_report_conflicting_segments_segment",   11701                         (Char const   *)"thread_report_conflicting_segments_segment",
11621                         "");   11702                         "");
11622   }   11703   }
11623   tmp___1 = __builtin_expect((long )(! (! p)), 1L);   11704   tmp___1 = __builtin_expect((long )(! (! p)), 1L);
11624   if (tmp___1) {   11705   if (tmp___1) {
11625     11706  
11626   } else {   11707   } else {
11627     vgPlain_assert_fail((Bool )0, (Char const   *)"p",   11708     vgPlain_assert_fail((Bool )0, (Char const   *)"p",
11628                         (Char const   *)"drd_thread.c", 1276,   11709                         (Char const   *)"drd_thread.c", 1276,
11629                         (Char const   *)"thread_report_conflicting_segments_segment",   11710                         (Char const   *)"thread_report_conflicting_segments_segment",
11630                         "");   11711                         "");
11631   }   11712   }
11632   i = 0U;   11713   i = 0U;
11633   while (i < 500U) {   11714   while (i < 500U) {
11634     if (i != (unsigned int )tid) {   11715     if (i != (unsigned int )tid) {
11635       q = vgDrd_g_threadinfo[i].sg_last;   11716       q = vgDrd_g_threadinfo[i].sg_last;
11636       while (q) {   11717       while (q) {
11637         tmp___2 = vgDrd_vc_lte((VectorClock const   */* const  */)(& q->vc),   11718         tmp___2 = vgDrd_vc_lte((VectorClock const   */* const  */)(& q->vc),
11638                                (VectorClock const   */* const  */)(& p->vc));   11719                                (VectorClock const   */* const  */)(& p->vc));
11639         if (tmp___2) {   11720         if (tmp___2) {
11640           break;   11721           break;
11641         } else {   11722         } else {
11642     11723  
11643         }   11724         }
11644         tmp___7 = vgDrd_vc_lte((VectorClock const   */* const  */)(& p->vc),   11725         tmp___7 = vgDrd_vc_lte((VectorClock const   */* const  */)(& p->vc),
11645                                (VectorClock const   */* const  */)(& q->vc));   11726                                (VectorClock const   */* const  */)(& q->vc));
11646         if (tmp___7) {   11727         if (tmp___7) {
11647     11728  
11648         } else {   11729         } else {
11649           tmp___5 = vgDrd_sg_bm((Segment */* const  */)q);   11730           tmp___5 = vgDrd_sg_bm((Segment */* const  */)q);
11650           tmp___6 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___5,   11731           tmp___6 = vgDrd_bm_has_conflict_with((struct bitmap */* const  */)tmp___5,
11651                                                addr, addr + size, access_type);   11732                                                addr, addr + size, access_type);
11652           if (tmp___6) {   11733           if (tmp___6) {
11653             tmp___3 = __builtin_expect((long )(! (! q->stacktrace)), 1L);   11734             tmp___3 = __builtin_expect((long )(! (! q->stacktrace)), 1L);
11654             if (tmp___3) {   11735             if (tmp___3) {
11655     11736  
11656             } else {   11737             } else {
11657               vgPlain_assert_fail((Bool )0, (Char const   *)"q->stacktrace",   11738               vgPlain_assert_fail((Bool )0, (Char const   *)"q->stacktrace",
11658                                   (Char const   *)"drd_thread.c", 1296,   11739                                   (Char const   *)"drd_thread.c", 1296,
11659                                   (Char const   *)"thread_report_conflicting_segments_segment",   11740                                   (Char const   *)"thread_report_conflicting_segments_segment",
11660                                   "");   11741                                   "");
11661             }   11742             }
11662             if (vgPlain_clo_xml) {   11743             if (vgPlain_clo_xml) {
11663               vgPlain_printf_xml("  <other_segment_start>\n");   11744               vgPlain_printf_xml("  <other_segment_start>\n");
11664             } else {   11745             } else {
11665               vgPlain_message((VgMsgKind )1,   11746               vgPlain_message((VgMsgKind )1,
11666                               "Other segment start (thread %d)\n", i);   11747                               "Other segment start (thread %d)\n", i);
11667             }   11748             }
11668             show_call_stack((DrdThreadId const   )i,   11749             show_call_stack((DrdThreadId const   )i,
11669                             (ExeContext */* const  */)q->stacktrace);   11750                             (ExeContext */* const  */)q->stacktrace);
11670             if (vgPlain_clo_xml) {   11751             if (vgPlain_clo_xml) {
11671               vgPlain_printf_xml("  </other_segment_start>\n  <other_segment_end>\n");   11752               vgPlain_printf_xml("  </other_segment_start>\n  <other_segment_end>\n");
11672             } else {   11753             } else {
11673               vgPlain_message((VgMsgKind )1, "Other segment end (thread %d)\n",   11754               vgPlain_message((VgMsgKind )1, "Other segment end (thread %d)\n",
11674                               i);   11755                               i);
11675             }   11756             }
11676             q_next = q->thr_next;   11757             q_next = q->thr_next;
11677             if (q_next) {   11758             if (q_next) {
11678               tmp___4 = q_next->stacktrace;   11759               tmp___4 = q_next->stacktrace;
11679             } else {   11760             } else {
11680               tmp___4 = (ExeContext *)0;   11761               tmp___4 = (ExeContext *)0;
11681             }   11762             }
11682             show_call_stack((DrdThreadId const   )i,   11763             show_call_stack((DrdThreadId const   )i,
11683                             (ExeContext */* const  */)tmp___4);   11764                             (ExeContext */* const  */)tmp___4);
11684             if (vgPlain_clo_xml) {   11765             if (vgPlain_clo_xml) {
11685               vgPlain_printf_xml("  </other_segment_end>\n");   11766               vgPlain_printf_xml("  </other_segment_end>\n");
11686             } else {   11767             } else {
11687     11768  
11688             }   11769             }
11689           } else {   11770           } else {
11690     11771  
11691           }   11772           }
11692         }   11773         }
11693         q = q->thr_prev;   11774         q = q->thr_prev;
11694       }   11775       }
11695     } else {   11776     } else {
11696     11777  
11697     }   11778     }
11698     i ++;   11779     i ++;
11699   }   11780   }
11700   return;   11781   return;
11701 }   11782 }
11702 }   11783 }
11703 void vgDrd_thread_report_conflicting_segments(DrdThreadId const   tid ,   11784 void vgDrd_thread_report_conflicting_segments(DrdThreadId const   tid ,
11704                                               Addr const   addr ,   11785                                               Addr const   addr ,
11705                                               SizeT const   size ,   11786                                               SizeT const   size ,
11706                                               BmAccessTypeT const   access_type )   11787                                               BmAccessTypeT const   access_type )
11707 {   11788 {
11708   Segment *p ;   11789   Segment *p ;
11709   int tmp ;   11790   int tmp ;
11710   long tmp___0 ;   11791   long tmp___0 ;
11711   struct bitmap *tmp___1 ;   11792   struct bitmap *tmp___1 ;
11712   Bool tmp___2 ;   11793   Bool tmp___2 ;
11713     11794  
11714   {   11795   {
11715   if (0 <= (int )tid) {   11796   if (0 <= (int )tid) {
11716     if (tid < 500U) {   11797     if (tid < 500U) {
11717       if (tid != 0U) {   11798       if (tid != 0U) {
11718         tmp = 1;   11799         tmp = 1;
11719       } else {   11800       } else {
11720         tmp = 0;   11801         tmp = 0;
11721       }   11802       }
11722     } else {   11803     } else {
11723       tmp = 0;   11804       tmp = 0;
11724     }   11805     }
11725   } else {   11806   } else {
11726     tmp = 0;   11807     tmp = 0;
11727   }   11808   }
11728   tmp___0 = __builtin_expect((long )tmp, 1L);   11809   tmp___0 = __builtin_expect((long )tmp, 1L);
11729   if (tmp___0) {   11810   if (tmp___0) {
11730     11811  
11731   } else {   11812   } else {
11732     vgPlain_assert_fail((Bool )0,   11813     vgPlain_assert_fail((Bool )0,
11733                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   11814                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
11734                         (Char const   *)"drd_thread.c", 1329,   11815                         (Char const   *)"drd_thread.c", 1329,
11735                         (Char const   *)"vgDrd_thread_report_conflicting_segments",   11816                         (Char const   *)"vgDrd_thread_report_conflicting_segments",
11736                         "");   11817                         "");
11737   }   11818   }
11738   p = vgDrd_g_threadinfo[tid].sg_first;   11819   p = vgDrd_g_threadinfo[tid].sg_first;
11739   while (p) {   11820   while (p) {
11740     tmp___1 = vgDrd_sg_bm((Segment */* const  */)p);   11821     tmp___1 = vgDrd_sg_bm((Segment */* const  */)p);
11741     tmp___2 = vgDrd_bm_has((struct bitmap */* const  */)tmp___1, addr,   11822     tmp___2 = vgDrd_bm_has((struct bitmap */* const  */)tmp___1, addr,
11742                            addr + size, access_type);   11823                            addr + size, access_type);
11743     if (tmp___2) {   11824     if (tmp___2) {
11744       thread_report_conflicting_segments_segment(tid, addr, size, access_type,   11825       thread_report_conflicting_segments_segment(tid, addr, size, access_type,
11745                                                  (Segment const   */* const  */)p);   11826                                                  (Segment const   */* const  */)p);
11746     } else {   11827     } else {
11747     11828  
11748     }   11829     }
11749     p = p->thr_next;   11830     p = p->thr_next;
11750   }   11831   }
11751   return;   11832   return;
11752 }   11833 }
11753 }   11834 }
11754 static Bool thread_conflict_set_up_to_date(DrdThreadId const   tid ) ;   11835 static Bool thread_conflict_set_up_to_date(DrdThreadId const   tid ) ;
11755 static int do_verify_conflict_set  =    -1;   11836 static int do_verify_conflict_set  =    -1;
11756 static Bool thread_conflict_set_up_to_date(DrdThreadId const   tid )   11837 static Bool thread_conflict_set_up_to_date(DrdThreadId const   tid )
11757 {   11838 {
11758   Bool result ;   11839   Bool result ;
11759   struct bitmap *computed_conflict_set ;   11840   struct bitmap *computed_conflict_set ;
11760   Char *tmp ;   11841   Char *tmp ;
11761     11842  
11762   {   11843   {
11763   computed_conflict_set = (struct bitmap *)0;   11844   computed_conflict_set = (struct bitmap *)0;
11764   if (do_verify_conflict_set < 0) {   11845   if (do_verify_conflict_set < 0) {
11765     tmp = vgPlain_getenv((Char *)"DRD_VERIFY_CONFLICT_SET");   11846     tmp = vgPlain_getenv((Char *)"DRD_VERIFY_CONFLICT_SET");
11766     do_verify_conflict_set = (unsigned int )tmp != (unsigned int )((Char *)0);   11847     do_verify_conflict_set = (unsigned int )tmp != (unsigned int )((Char *)0);
11767   } else {   11848   } else {
11768     11849  
11769   }   11850   }
11770   if (do_verify_conflict_set == 0) {   11851   if (do_verify_conflict_set == 0) {
11771     return ((Bool )1);   11852     return ((Bool )1);
11772   } else {   11853   } else {
11773     11854  
11774   }   11855   }
11775   thread_compute_conflict_set(& computed_conflict_set, tid);   11856   thread_compute_conflict_set(& computed_conflict_set, tid);
11776   result = vgDrd_bm_equal((struct bitmap */* const  */)vgDrd_g_conflict_set,   11857   result = vgDrd_bm_equal((struct bitmap */* const  */)vgDrd_g_conflict_set,
11777                           (struct bitmap */* const  */)computed_conflict_set);   11858                           (struct bitmap */* const  */)computed_conflict_set);
11778   if (! result) {   11859   if (! result) {
11779     vgPlain_printf("actual conflict set:\n");   11860     vgPlain_printf("actual conflict set:\n");
11780     vgDrd_bm_print((struct bitmap */* const  */)vgDrd_g_conflict_set);   11861     vgDrd_bm_print((struct bitmap */* const  */)vgDrd_g_conflict_set);
11781     vgPlain_printf("\n");   11862     vgPlain_printf("\n");
11782     vgPlain_printf("computed conflict set:\n");   11863     vgPlain_printf("computed conflict set:\n");
11783     vgDrd_bm_print((struct bitmap */* const  */)computed_conflict_set);   11864     vgDrd_bm_print((struct bitmap */* const  */)computed_conflict_set);
11784     vgPlain_printf("\n");   11865     vgPlain_printf("\n");
11785   } else {   11866   } else {
11786     11867  
11787   }   11868   }
11788   vgDrd_bm_delete((struct bitmap */* const  */)computed_conflict_set);   11869   vgDrd_bm_delete((struct bitmap */* const  */)computed_conflict_set);
11789   return (result);   11870   return (result);
11790 }   11871 }
11791 }   11872 }
11792 static void thread_compute_conflict_set(struct bitmap **conflict_set ,   11873 static void thread_compute_conflict_set(struct bitmap **conflict_set ,
11793                                         DrdThreadId const   tid )   11874                                         DrdThreadId const   tid )
11794 {   11875 {
11795   Segment *p ;   11876   Segment *p ;
11796   int tmp ;   11877   int tmp ;
11797   long tmp___0 ;   11878   long tmp___0 ;
11798   long tmp___1 ;   11879   long tmp___1 ;
11799   ULong tmp___2 ;   11880   ULong tmp___2 ;
11800   ULong tmp___3 ;   11881   ULong tmp___3 ;
11801   char *str ;   11882   char *str ;
11802   VectorClock *tmp___4 ;   11883   VectorClock *tmp___4 ;
11803   unsigned int j ;   11884   unsigned int j ;
11804   char *vc ;   11885   char *vc ;
11805   Segment *q ;   11886   Segment *q ;
11806   char *str___0 ;   11887   char *str___0 ;
11807   struct bitmap *tmp___5 ;   11888   struct bitmap *tmp___5 ;
11808   char *str___1 ;   11889   char *str___1 ;
11809   Bool tmp___6 ;   11890   Bool tmp___6 ;
11810   Bool tmp___7 ;   11891   Bool tmp___7 ;
11811   Bool tmp___8 ;   11892   Bool tmp___8 ;
11812   ULong tmp___9 ;   11893   ULong tmp___9 ;
11813   ULong tmp___10 ;   11894   ULong tmp___10 ;
11814     11895  
11815   {   11896   {
11816   if (0 <= (int )tid) {   11897   if (0 <= (int )tid) {
11817     if (tid < 500U) {   11898     if (tid < 500U) {
11818       if (tid != 0U) {   11899       if (tid != 0U) {
11819         tmp = 1;   11900         tmp = 1;
11820       } else {   11901       } else {
11821         tmp = 0;   11902         tmp = 0;
11822       }   11903       }
11823     } else {   11904     } else {
11824       tmp = 0;   11905       tmp = 0;
11825     }   11906     }
11826   } else {   11907   } else {
11827     tmp = 0;   11908     tmp = 0;
11828   }   11909   }
11829   tmp___0 = __builtin_expect((long )tmp, 1L);   11910   tmp___0 = __builtin_expect((long )tmp, 1L);
11830   if (tmp___0) {   11911   if (tmp___0) {
11831     11912  
11832   } else {   11913   } else {
11833     vgPlain_assert_fail((Bool )0,   11914     vgPlain_assert_fail((Bool )0,
11834                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   11915                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
11835                         (Char const   *)"drd_thread.c", 1380,   11916                         (Char const   *)"drd_thread.c", 1380,
11836                         (Char const   *)"thread_compute_conflict_set", "");   11917                         (Char const   *)"thread_compute_conflict_set", "");
11837   }   11918   }
11838   tmp___1 = __builtin_expect((long )(! (! (tid == (DrdThreadId const   )vgDrd_g_drd_running_tid))),   11919   tmp___1 = __builtin_expect((long )(! (! (tid == (DrdThreadId const   )vgDrd_g_drd_running_tid))),
11839                              1L);   11920                              1L);
11840   if (tmp___1) {   11921   if (tmp___1) {
11841     11922  
11842   } else {   11923   } else {
11843     vgPlain_assert_fail((Bool )0,   11924     vgPlain_assert_fail((Bool )0,
11844                         (Char const   *)"tid == DRD_(g_drd_running_tid)",   11925                         (Char const   *)"tid == DRD_(g_drd_running_tid)",
11845                         (Char const   *)"drd_thread.c", 1381,   11926                         (Char const   *)"drd_thread.c", 1381,
11846                         (Char const   *)"thread_compute_conflict_set", "");   11927                         (Char const   *)"thread_compute_conflict_set", "");
11847   }   11928   }
11848   s_compute_conflict_set_count ++;   11929   s_compute_conflict_set_count ++;
11849   tmp___2 = vgDrd_bm_get_bitmap_creation_count();   11930   tmp___2 = vgDrd_bm_get_bitmap_creation_count();
11850   s_conflict_set_bitmap_creation_count -= tmp___2;   11931   s_conflict_set_bitmap_creation_count -= tmp___2;
11851   tmp___3 = vgDrd_bm_get_bitmap2_creation_count();   11932   tmp___3 = vgDrd_bm_get_bitmap2_creation_count();
11852   s_conflict_set_bitmap2_creation_count -= tmp___3;   11933   s_conflict_set_bitmap2_creation_count -= tmp___3;
11853   if (*conflict_set) {   11934   if (*conflict_set) {
11854     vgDrd_bm_cleanup((struct bitmap */* const  */)*conflict_set);   11935     vgDrd_bm_cleanup((struct bitmap */* const  */)*conflict_set);
11855     vgDrd_bm_init((struct bitmap */* const  */)*conflict_set);   11936     vgDrd_bm_init((struct bitmap */* const  */)*conflict_set);
11856   } else {   11937   } else {
11857     *conflict_set = vgDrd_bm_new();   11938     *conflict_set = vgDrd_bm_new();
11858   }   11939   }
11859   if (s_trace_conflict_set) {   11940   if (s_trace_conflict_set) {
11860     tmp___4 = vgDrd_thread_get_vc(tid);   11941     tmp___4 = vgDrd_thread_get_vc(tid);
11861     str = vgDrd_vc_aprint((VectorClock const   */* const  */)tmp___4);   11942     str = vgDrd_vc_aprint((VectorClock const   */* const  */)tmp___4);
11862     vgPlain_message((VgMsgKind )2,   11943     vgPlain_message((VgMsgKind )2,
11863                     "computing conflict set for thread %d with vc %s\n", tid,   11944                     "computing conflict set for thread %d with vc %s\n", tid,
11864                     str);   11945                     str);
11865     vgPlain_free((void *)str);   11946     vgPlain_free((void *)str);
11866   } else {   11947   } else {
11867     11948  
11868   }   11949   }
11869   p = vgDrd_g_threadinfo[tid].sg_last;   11950   p = vgDrd_g_threadinfo[tid].sg_last;
11870   if (s_trace_conflict_set) {   11951   if (s_trace_conflict_set) {
11871     vc = vgDrd_vc_aprint((VectorClock const   */* const  */)(& p->vc));   11952     vc = vgDrd_vc_aprint((VectorClock const   */* const  */)(& p->vc));
11872     vgPlain_message((VgMsgKind )2, "conflict set: thread [%d] at vc %s\n", tid,   11953     vgPlain_message((VgMsgKind )2, "conflict set: thread [%d] at vc %s\n", tid,
11873                     vc);   11954                     vc);
11874     vgPlain_free((void *)vc);   11955     vgPlain_free((void *)vc);
11875   } else {   11956   } else {
11876     11957  
11877   }   11958   }
11878   j = 0U;   11959   j = 0U;
11879   while (j < 500U) {   11960   while (j < 500U) {
11880     if (j != (unsigned int )tid) {   11961     if (j != (unsigned int )tid) {
11881       tmp___8 = vgDrd_IsValidDrdThreadId((DrdThreadId const   )j);   11962       tmp___8 = vgDrd_IsValidDrdThreadId((DrdThreadId const   )j);
11882       if (tmp___8) {   11963       if (tmp___8) {
11883         q = vgDrd_g_threadinfo[j].sg_last;   11964         q = vgDrd_g_threadinfo[j].sg_last;
11884         while (q) {   11965         while (q) {
11885           tmp___6 = vgDrd_vc_lte((VectorClock const   */* const  */)(& q->vc),   11966           tmp___6 = vgDrd_vc_lte((VectorClock const   */* const  */)(& q->vc),
11886                                  (VectorClock const   */* const  */)(& p->vc));   11967                                  (VectorClock const   */* const  */)(& p->vc));
11887           if (tmp___6) {   11968           if (tmp___6) {
11888             _L: /* CIL Label */   11969             _L: /* CIL Label */
11889             if (s_trace_conflict_set) {   11970             if (s_trace_conflict_set) {
11890               str___1 = vgDrd_vc_aprint((VectorClock const   */* const  */)(& q->vc));   11971               str___1 = vgDrd_vc_aprint((VectorClock const   */* const  */)(& q->vc));
11891               vgPlain_message((VgMsgKind )2,   11972               vgPlain_message((VgMsgKind )2,
11892                               "conflict set: [%d] ignoring segment %s\n", j,   11973                               "conflict set: [%d] ignoring segment %s\n", j,
11893                               str___1);   11974                               str___1);
11894               vgPlain_free((void *)str___1);   11975               vgPlain_free((void *)str___1);
11895             } else {   11976             } else {
11896     11977  
11897             }   11978             }
11898           } else {   11979           } else {
11899             tmp___7 = vgDrd_vc_lte((VectorClock const   */* const  */)(& p->vc),   11980             tmp___7 = vgDrd_vc_lte((VectorClock const   */* const  */)(& p->vc),
11900                                    (VectorClock const   */* const  */)(& q->vc));   11981                                    (VectorClock const   */* const  */)(& q->vc));
11901             if (tmp___7) {   11982             if (tmp___7) {
11902               goto _L;   11983               goto _L;
11903             } else {   11984             } else {
11904               if (s_trace_conflict_set) {   11985               if (s_trace_conflict_set) {
11905                 str___0 = vgDrd_vc_aprint((VectorClock const   */* const  */)(& q->vc));   11986                 str___0 = vgDrd_vc_aprint((VectorClock const   */* const  */)(& q->vc));
11906                 vgPlain_message((VgMsgKind )2,   11987                 vgPlain_message((VgMsgKind )2,
11907                                 "conflict set: [%d] merging segment %s\n", j,   11988                                 "conflict set: [%d] merging segment %s\n", j,
11908                                 str___0);   11989                                 str___0);
11909                 vgPlain_free((void *)str___0);   11990                 vgPlain_free((void *)str___0);
11910               } else {   11991               } else {
11911     11992  
11912               }   11993               }
11913               tmp___5 = vgDrd_sg_bm((Segment */* const  */)q);   11994               tmp___5 = vgDrd_sg_bm((Segment */* const  */)q);
11914               vgDrd_bm_merge2((struct bitmap */* const  */)*conflict_set,   11995               vgDrd_bm_merge2((struct bitmap */* const  */)*conflict_set,
11915                               (struct bitmap */* const  */)tmp___5);   11996                               (struct bitmap */* const  */)tmp___5);
11916             }   11997             }
11917           }   11998           }
11918           q = q->thr_prev;   11999           q = q->thr_prev;
11919         }   12000         }
11920       } else {   12001       } else {
11921     12002  
11922       }   12003       }
11923     } else {   12004     } else {
11924     12005  
11925     }   12006     }
11926     j ++;   12007     j ++;
11927   }   12008   }
11928   tmp___9 = vgDrd_bm_get_bitmap_creation_count();   12009   tmp___9 = vgDrd_bm_get_bitmap_creation_count();
11929   s_conflict_set_bitmap_creation_count += tmp___9;   12010   s_conflict_set_bitmap_creation_count += tmp___9;
11930   tmp___10 = vgDrd_bm_get_bitmap2_creation_count();   12011   tmp___10 = vgDrd_bm_get_bitmap2_creation_count();
11931   s_conflict_set_bitmap2_creation_count += tmp___10;   12012   s_conflict_set_bitmap2_creation_count += tmp___10;
11932   if (s_trace_conflict_set_bm) {   12013   if (s_trace_conflict_set_bm) {
11933     vgPlain_message((VgMsgKind )2, "[%d] new conflict set:\n", tid);   12014     vgPlain_message((VgMsgKind )2, "[%d] new conflict set:\n", tid);
11934     vgDrd_bm_print((struct bitmap */* const  */)*conflict_set);   12015     vgDrd_bm_print((struct bitmap */* const  */)*conflict_set);
11935     vgPlain_message((VgMsgKind )2, "[%d] end of new conflict set.\n", tid);   12016     vgPlain_message((VgMsgKind )2, "[%d] end of new conflict set.\n", tid);
11936   } else {   12017   } else {
11937     12018  
11938   }   12019   }
11939   return;   12020   return;
11940 }   12021 }
11941 }   12022 }
11942 void vgDrd_thread_update_conflict_set(DrdThreadId const   tid ,   12023 void vgDrd_thread_update_conflict_set(DrdThreadId const   tid ,
11943                                       VectorClock const   * const  old_vc )   12024                                       VectorClock const   * const  old_vc )
11944 {   12025 {
11945   VectorClock const   *new_vc ;   12026   VectorClock const   *new_vc ;
11946   Segment *p ;   12027   Segment *p ;
11947   unsigned int j ;   12028   unsigned int j ;
11948   int tmp ;   12029   int tmp ;
11949   long tmp___0 ;   12030   long tmp___0 ;
11950   long tmp___1 ;   12031   long tmp___1 ;
11951   long tmp___2 ;   12032   long tmp___2 ;
11952   long tmp___3 ;   12033   long tmp___3 ;
11953   char *str ;   12034   char *str ;
11954   VectorClock *tmp___4 ;   12035   VectorClock *tmp___4 ;
11955   VectorClock *tmp___5 ;   12036   VectorClock *tmp___5 ;
11956   Bool tmp___6 ;   12037   Bool tmp___6 ;
11957   int tmp___7 ;   12038   int tmp___7 ;
11958   long tmp___8 ;   12039   long tmp___8 ;
11959   Segment *q ;   12040   Segment *q ;
11960   Bool tmp___9 ;   12041   Bool tmp___9 ;
11961   Bool included_in_old_conflict_set ;   12042   Bool included_in_old_conflict_set ;
11962   Bool tmp___10 ;   12043   Bool tmp___10 ;
11963   int tmp___11 ;   12044   int tmp___11 ;
11964   Bool included_in_new_conflict_set ;   12045   Bool included_in_new_conflict_set ;
11965   Bool tmp___12 ;   12046   Bool tmp___12 ;
11966   int tmp___13 ;   12047   int tmp___13 ;
11967   char *str___0 ;   12048   char *str___0 ;
11968   char const   *tmp___14 ;   12049   char const   *tmp___14 ;
11969   long tmp___15 ;   12050   long tmp___15 ;
11970   struct bitmap *tmp___16 ;   12051   struct bitmap *tmp___16 ;
11971   Bool tmp___17 ;   12052   Bool tmp___17 ;
11972   Bool included_in_old_conflict_set___0 ;   12053   Bool included_in_old_conflict_set___0 ;
11973   Bool tmp___18 ;   12054   Bool tmp___18 ;
11974   int tmp___19 ;   12055   int tmp___19 ;
11975   Bool included_in_new_conflict_set___0 ;   12056   Bool included_in_new_conflict_set___0 ;
11976   Bool tmp___20 ;   12057   Bool tmp___20 ;
11977   Bool tmp___21 ;   12058   Bool tmp___21 ;
11978   int tmp___22 ;   12059   int tmp___22 ;
11979   char *str___1 ;   12060   char *str___1 ;
11980   char const   *tmp___23 ;   12061   char const   *tmp___23 ;
11981   long tmp___24 ;   12062   long tmp___24 ;
11982   struct bitmap *tmp___25 ;   12063   struct bitmap *tmp___25 ;
11983   Bool tmp___26 ;   12064   Bool tmp___26 ;
11984   Segment *q___0 ;   12065   Segment *q___0 ;
11985   struct bitmap *tmp___27 ;   12066   struct bitmap *tmp___27 ;
11986   Bool tmp___28 ;   12067   Bool tmp___28 ;
11987   Bool tmp___29 ;   12068   Bool tmp___29 ;
11988   Bool tmp___30 ;   12069   Bool tmp___30 ;
11989   Bool tmp___31 ;   12070   Bool tmp___31 ;
11990   int tmp___32 ;   12071   int tmp___32 ;
11991   long tmp___33 ;   12072   long tmp___33 ;
11992     12073  
11993   {   12074   {
11994   if (0 <= (int )tid) {   12075   if (0 <= (int )tid) {
11995     if (tid < 500U) {   12076     if (tid < 500U) {
11996       if (tid != 0U) {   12077       if (tid != 0U) {
11997         tmp = 1;   12078         tmp = 1;
11998       } else {   12079       } else {
11999         tmp = 0;   12080         tmp = 0;
12000       }   12081       }
12001     } else {   12082     } else {
12002       tmp = 0;   12083       tmp = 0;
12003     }   12084     }
12004   } else {   12085   } else {
12005     tmp = 0;   12086     tmp = 0;
12006   }   12087   }
12007   tmp___0 = __builtin_expect((long )tmp, 1L);   12088   tmp___0 = __builtin_expect((long )tmp, 1L);
12008   if (tmp___0) {   12089   if (tmp___0) {
12009     12090  
12010   } else {   12091   } else {
12011     vgPlain_assert_fail((Bool )0,   12092     vgPlain_assert_fail((Bool )0,
12012                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",   12093                         (Char const   *)"0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID",
12013                         (Char const   *)"drd_thread.c", 1477,   12094                         (Char const   *)"drd_thread.c", 1477,
12014                         (Char const   *)"vgDrd_thread_update_conflict_set", "");   12095                         (Char const   *)"vgDrd_thread_update_conflict_set", "");
12015   }   12096   }
12016   tmp___1 = __builtin_expect((long )(! (! old_vc)), 1L);   12097   tmp___1 = __builtin_expect((long )(! (! old_vc)), 1L);
12017   if (tmp___1) {   12098   if (tmp___1) {
12018     12099  
12019   } else {   12100   } else {
12020     vgPlain_assert_fail((Bool )0, (Char const   *)"old_vc",   12101     vgPlain_assert_fail((Bool )0, (Char const   *)"old_vc",
12021                         (Char const   *)"drd_thread.c", 1478,   12102                         (Char const   *)"drd_thread.c", 1478,
12022                         (Char const   *)"vgDrd_thread_update_conflict_set", "");   12103                         (Char const   *)"vgDrd_thread_update_conflict_set", "");
12023   }   12104   }
12024   tmp___2 = __builtin_expect((long )(! (! (tid == (DrdThreadId const   )vgDrd_g_drd_running_tid))),   12105   tmp___2 = __builtin_expect((long )(! (! (tid == (DrdThreadId const   )vgDrd_g_drd_running_tid))),
12025                              1L);   12106                              1L);
12026   if (tmp___2) {   12107   if (tmp___2) {
12027     12108  
12028   } else {   12109   } else {
12029     vgPlain_assert_fail((Bool )0,   12110     vgPlain_assert_fail((Bool )0,
12030                         (Char const   *)"tid == DRD_(g_drd_running_tid)",   12111                         (Char const   *)"tid == DRD_(g_drd_running_tid)",
12031                         (Char const   *)"drd_thread.c", 1479,   12112                         (Char const   *)"drd_thread.c", 1479,
12032                         (Char const   *)"vgDrd_thread_update_conflict_set", "");   12113                         (Char const   *)"vgDrd_thread_update_conflict_set", "");
12033   }   12114   }
12034   tmp___3 = __builtin_expect((long )(! (! vgDrd_g_conflict_set)), 1L);   12115   tmp___3 = __builtin_expect((long )(! (! vgDrd_g_conflict_set)), 1L);
12035   if (tmp___3) {   12116   if (tmp___3) {
12036     12117  
12037   } else {   12118   } else {
12038     vgPlain_assert_fail((Bool )0, (Char const   *)"DRD_(g_conflict_set)",   12119     vgPlain_assert_fail((Bool )0, (Char const   *)"DRD_(g_conflict_set)",
12039                         (Char const   *)"drd_thread.c", 1480,   12120                         (Char const   *)"drd_thread.c", 1480,
12040                         (Char const   *)"vgDrd_thread_update_conflict_set", "");   12121                         (Char const   *)"vgDrd_thread_update_conflict_set", "");
12041   }   12122   }
12042   if (s_trace_conflict_set) {   12123   if (s_trace_conflict_set) {
12043     tmp___4 = vgDrd_thread_get_vc(tid);   12124     tmp___4 = vgDrd_thread_get_vc(tid);
12044     str = vgDrd_vc_aprint((VectorClock const   */* const  */)tmp___4);   12125     str = vgDrd_vc_aprint((VectorClock const   */* const  */)tmp___4);
12045     vgPlain_message((VgMsgKind )2,   12126     vgPlain_message((VgMsgKind )2,
12046                     "updating conflict set for thread %d with vc %s\n", tid, str);   12127                     "updating conflict set for thread %d with vc %s\n", tid, str);
12047     vgPlain_free((void *)str);   12128     vgPlain_free((void *)str);
12048   } else {   12129   } else {
12049     12130  
12050   }   12131   }
12051   tmp___5 = vgDrd_thread_get_vc(tid);   12132   tmp___5 = vgDrd_thread_get_vc(tid);
12052   new_vc = (VectorClock const   *)tmp___5;   12133   new_vc = (VectorClock const   *)tmp___5;
12053   tmp___6 = vgDrd_vc_lte(old_vc, (VectorClock const   */* const  */)new_vc);   12134   tmp___6 = vgDrd_vc_lte(old_vc, (VectorClock const   */* const  */)new_vc);
12054   if (tmp___6) {   12135   if (tmp___6) {
12055     tmp___7 = 1;   12136     tmp___7 = 1;
12056   } else {   12137   } else {
12057     tmp___7 = 0;   12138     tmp___7 = 0;
12058   }   12139   }
12059   tmp___8 = __builtin_expect((long )tmp___7, 1L);   12140   tmp___8 = __builtin_expect((long )tmp___7, 1L);
12060   if (tmp___8) {   12141   if (tmp___8) {
12061     12142  
12062   } else {   12143   } else {
12063     vgPlain_assert_fail((Bool )0,   12144     vgPlain_assert_fail((Bool )0,
12064                         (Char const   *)"DRD_(vc_lte)(old_vc, new_vc)",   12145                         (Char const   *)"DRD_(vc_lte)(old_vc, new_vc)",
12065                         (Char const   *)"drd_thread.c", 1493,   12146                         (Char const   *)"drd_thread.c", 1493,
12066                         (Char const   *)"vgDrd_thread_update_conflict_set", "");   12147                         (Char const   *)"vgDrd_thread_update_conflict_set", "");
12067   }   12148   }
12068   vgDrd_bm_unmark(vgDrd_g_conflict_set);   12149   vgDrd_bm_unmark(vgDrd_g_conflict_set);
12069   j = 0U;   12150   j = 0U;
12070   while (j < 500U) {   12151   while (j < 500U) {
12071     if (j == (unsigned int )tid) {   12152     if (j == (unsigned int )tid) {
12072       goto __Cont;   12153       goto __Cont;
12073     } else {   12154     } else {
12074       tmp___9 = vgDrd_IsValidDrdThreadId((DrdThreadId const   )j);   12155       tmp___9 = vgDrd_IsValidDrdThreadId((DrdThreadId const   )j);
12075       if (tmp___9) {   12156       if (tmp___9) {
12076     12157  
12077       } else {   12158       } else {
12078         goto __Cont;   12159         goto __Cont;
12079       }   12160       }
12080     }   12161     }
12081     q = vgDrd_g_threadinfo[j].sg_last;   12162     q = vgDrd_g_threadinfo[j].sg_last;
12082     while (1) {   12163     while (1) {
12083       if (q) {   12164       if (q) {
12084         tmp___17 = vgDrd_vc_lte((VectorClock const   */* const  */)(& q->vc),   12165         tmp___17 = vgDrd_vc_lte((VectorClock const   */* const  */)(& q->vc),
12085                                 (VectorClock const   */* const  */)new_vc);   12166                                 (VectorClock const   */* const  */)new_vc);
12086         if (tmp___17) {   12167         if (tmp___17) {
12087           break;   12168           break;
12088         } else {   12169         } else {
12089     12170  
12090         }   12171         }
12091       } else {   12172       } else {
12092         break;   12173         break;
12093       }   12174       }
12094       tmp___10 = vgDrd_vc_lte(old_vc,   12175       tmp___10 = vgDrd_vc_lte(old_vc,
12095                               (VectorClock const   */* const  */)(& q->vc));   12176                               (VectorClock const   */* const  */)(& q->vc));
12096       if (tmp___10) {   12177       if (tmp___10) {
12097         tmp___11 = 0;   12178         tmp___11 = 0;
12098       } else {   12179       } else {
12099         tmp___11 = 1;   12180         tmp___11 = 1;
12100       }   12181       }
12101       included_in_old_conflict_set = (Bool )tmp___11;   12182       included_in_old_conflict_set = (Bool )tmp___11;
12102       tmp___12 = vgDrd_vc_lte((VectorClock const   */* const  */)new_vc,   12183       tmp___12 = vgDrd_vc_lte((VectorClock const   */* const  */)new_vc,
12103                               (VectorClock const   */* const  */)(& q->vc));   12184                               (VectorClock const   */* const  */)(& q->vc));
12104       if (tmp___12) {   12185       if (tmp___12) {
12105         tmp___13 = 0;   12186         tmp___13 = 0;
12106       } else {   12187       } else {
12107         tmp___13 = 1;   12188         tmp___13 = 1;
12108       }   12189       }
12109       included_in_new_conflict_set = (Bool )tmp___13;   12190       included_in_new_conflict_set = (Bool )tmp___13;
12110       tmp___15 = __builtin_expect((long )(! (! s_trace_conflict_set)), 0L);   12191       tmp___15 = __builtin_expect((long )(! (! s_trace_conflict_set)), 0L);
12111       if (tmp___15) {   12192       if (tmp___15) {
12112         str___0 = vgDrd_vc_aprint((VectorClock const   */* const  */)(& q->vc));   12193         str___0 = vgDrd_vc_aprint((VectorClock const   */* const  */)(& q->vc));
12113         if ((int )included_in_old_conflict_set != (int )included_in_new_conflict_set) {   12194         if ((int )included_in_old_conflict_set != (int )included_in_new_conflict_set) {
12114           tmp___14 = "merging";   12195           tmp___14 = "merging";
12115         } else {   12196         } else {
12116           tmp___14 = "ignoring";   12197           tmp___14 = "ignoring";
12117         }   12198         }
12118         vgPlain_message((VgMsgKind )2, "conflict set: [%d] %s segment %s\n", j,   12199         vgPlain_message((VgMsgKind )2, "conflict set: [%d] %s segment %s\n", j,
12119                         tmp___14, str___0);   12200                         tmp___14, str___0);
12120         vgPlain_free((void *)str___0);   12201         vgPlain_free((void *)str___0);
12121       } else {   12202       } else {
12122     12203  
12123       }   12204       }
12124       if ((int )included_in_old_conflict_set != (int )included_in_new_conflict_set) {   12205       if ((int )included_in_old_conflict_set != (int )included_in_new_conflict_set) {
12125         tmp___16 = vgDrd_sg_bm((Segment */* const  */)q);   12206         tmp___16 = vgDrd_sg_bm((Segment */* const  */)q);
12126         vgDrd_bm_mark(vgDrd_g_conflict_set, tmp___16);   12207         vgDrd_bm_mark(vgDrd_g_conflict_set, tmp___16);
12127       } else {   12208       } else {
12128     12209  
12129       }   12210       }
12130       q = q->thr_prev;   12211       q = q->thr_prev;
12131     }   12212     }
12132     while (1) {   12213     while (1) {
12133       if (q) {   12214       if (q) {
12134         tmp___26 = vgDrd_vc_lte((VectorClock const   */* const  */)(& q->vc),   12215         tmp___26 = vgDrd_vc_lte((VectorClock const   */* const  */)(& q->vc),
12135                                 old_vc);   12216                                 old_vc);
12136         if (tmp___26) {   12217         if (tmp___26) {
12137           break;   12218           break;
12138         } else {   12219         } else {
12139     12220  
12140         }   12221         }
12141       } else {   12222       } else {
12142         break;   12223         break;
12143       }   12224       }
12144       tmp___18 = vgDrd_vc_lte(old_vc,   12225       tmp___18 = vgDrd_vc_lte(old_vc,
12145                               (VectorClock const   */* const  */)(& q->vc));   12226                               (VectorClock const   */* const  */)(& q->vc));
12146       if (tmp___18) {   12227       if (tmp___18) {
12147         tmp___19 = 0;   12228         tmp___19 = 0;
12148       } else {   12229       } else {
12149         tmp___19 = 1;   12230         tmp___19 = 1;
12150       }   12231       }
12151       included_in_old_conflict_set___0 = (Bool )tmp___19;   12232       included_in_old_conflict_set___0 = (Bool )tmp___19;
12152       tmp___20 = vgDrd_vc_lte((VectorClock const   */* const  */)(& q->vc),   12233       tmp___20 = vgDrd_vc_lte((VectorClock const   */* const  */)(& q->vc),
12153                               (VectorClock const   */* const  */)new_vc);   12234                               (VectorClock const   */* const  */)new_vc);
12154       if (tmp___20) {   12235       if (tmp___20) {
12155         tmp___22 = 0;   12236         tmp___22 = 0;
12156       } else {   12237       } else {
12157         tmp___21 = vgDrd_vc_lte((VectorClock const   */* const  */)new_vc,   12238         tmp___21 = vgDrd_vc_lte((VectorClock const   */* const  */)new_vc,
12158                                 (VectorClock const   */* const  */)(& q->vc));   12239                                 (VectorClock const   */* const  */)(& q->vc));
12159         if (tmp___21) {   12240         if (tmp___21) {
12160           tmp___22 = 0;   12241           tmp___22 = 0;
12161         } else {   12242         } else {
12162           tmp___22 = 1;   12243           tmp___22 = 1;
12163         }   12244         }
12164       }   12245       }
12165       included_in_new_conflict_set___0 = (Bool )tmp___22;   12246       included_in_new_conflict_set___0 = (Bool )tmp___22;
12166       tmp___24 = __builtin_expect((long )(! (! s_trace_conflict_set)), 0L);   12247       tmp___24 = __builtin_expect((long )(! (! s_trace_conflict_set)), 0L);
12167       if (tmp___24) {   12248       if (tmp___24) {
12168         str___1 = vgDrd_vc_aprint((VectorClock const   */* const  */)(& q->vc));   12249         str___1 = vgDrd_vc_aprint((VectorClock const   */* const  */)(& q->vc));
12169         if ((int )included_in_old_conflict_set___0 != (int )included_in_new_conflict_set___0) {   12250         if ((int )included_in_old_conflict_set___0 != (int )included_in_new_conflict_set___0) {
12170           tmp___23 = "merging";   12251           tmp___23 = "merging";
12171         } else {   12252         } else {
12172           tmp___23 = "ignoring";   12253           tmp___23 = "ignoring";
12173         }   12254         }
12174         vgPlain_message((VgMsgKind )2, "conflict set: [%d] %s segment %s\n", j,   12255         vgPlain_message((VgMsgKind )2, "conflict set: [%d] %s segment %s\n", j,
12175                         tmp___23, str___1);   12256                         tmp___23, str___1);
12176         vgPlain_free((void *)str___1);   12257         vgPlain_free((void *)str___1);
12177       } else {   12258       } else {
12178     12259  
12179       }   12260       }
12180       if ((int )included_in_old_conflict_set___0 != (int )included_in_new_conflict_set___0) {   12261       if ((int )included_in_old_conflict_set___0 != (int )included_in_new_conflict_set___0) {
12181         tmp___25 = vgDrd_sg_bm((Segment */* const  */)q);   12262         tmp___25 = vgDrd_sg_bm((Segment */* const  */)q);
12182         vgDrd_bm_mark(vgDrd_g_conflict_set, tmp___25);   12263         vgDrd_bm_mark(vgDrd_g_conflict_set, tmp___25);
12183       } else {   12264       } else {
12184     12265  
12185       }   12266       }
12186       q = q->thr_prev;   12267       q = q->thr_prev;
12187     }   12268     }
12188     __Cont: /* CIL Label */   12269     __Cont: /* CIL Label */
12189     j ++;   12270     j ++;
12190   }   12271   }
12191   vgDrd_bm_clear_marked(vgDrd_g_conflict_set);   12272   vgDrd_bm_clear_marked(vgDrd_g_conflict_set);
12192   p = vgDrd_g_threadinfo[tid].sg_last;   12273   p = vgDrd_g_threadinfo[tid].sg_last;
12193   j = 0U;   12274   j = 0U;
12194   while (j < 500U) {   12275   while (j < 500U) {
12195     if (j != (unsigned int )tid) {   12276     if (j != (unsigned int )tid) {
12196       tmp___30 = vgDrd_IsValidDrdThreadId((DrdThreadId const   )j);   12277       tmp___30 = vgDrd_IsValidDrdThreadId((DrdThreadId const   )j);
12197       if (tmp___30) {   12278       if (tmp___30) {
12198         q___0 = vgDrd_g_threadinfo[j].sg_last;   12279         q___0 = vgDrd_g_threadinfo[j].sg_last;
12199         while (1) {   12280         while (1) {
12200           if (q___0) {   12281           if (q___0) {
12201             tmp___29 = vgDrd_vc_lte((VectorClock const   */* const  */)(& q___0->vc),   12282             tmp___29 = vgDrd_vc_lte((VectorClock const   */* const  */)(& q___0->vc),
12202                                     (VectorClock const   */* const  */)(& p->vc));   12283                                     (VectorClock const   */* const  */)(& p->vc));
12203             if (tmp___29) {   12284             if (tmp___29) {
12204               break;   12285               break;
12205             } else {   12286             } else {
12206     12287  
12207             }   12288             }
12208           } else {   12289           } else {
12209             break;   12290             break;
12210           }   12291           }
12211           tmp___28 = vgDrd_vc_lte((VectorClock const   */* const  */)(& p->vc),   12292           tmp___28 = vgDrd_vc_lte((VectorClock const   */* const  */)(& p->vc),
12212                                   (VectorClock const   */* const  */)(& q___0->vc));   12293                                   (VectorClock const   */* const  */)(& q___0->vc));
12213           if (tmp___28) {   12294           if (tmp___28) {
12214     12295  
12215           } else {   12296           } else {
12216             tmp___27 = vgDrd_sg_bm((Segment */* const  */)q___0);   12297             tmp___27 = vgDrd_sg_bm((Segment */* const  */)q___0);
12217             vgDrd_bm_merge2_marked((struct bitmap */* const  */)vgDrd_g_conflict_set,   12298             vgDrd_bm_merge2_marked((struct bitmap */* const  */)vgDrd_g_conflict_set,
12218                                    (struct bitmap */* const  */)tmp___27);   12299                                    (struct bitmap */* const  */)tmp___27);
12219           }   12300           }
12220           q___0 = q___0->thr_prev;   12301           q___0 = q___0->thr_prev;
12221         }   12302         }
12222       } else {   12303       } else {
12223     12304  
12224       }   12305       }
12225     } else {   12306     } else {
12226     12307  
12227     }   12308     }
12228     j ++;   12309     j ++;
12229   }   12310   }
12230   vgDrd_bm_remove_cleared_marked(vgDrd_g_conflict_set);   12311   vgDrd_bm_remove_cleared_marked(vgDrd_g_conflict_set);
12231   s_update_conflict_set_count ++;   12312   s_update_conflict_set_count ++;
12232   if (s_trace_conflict_set_bm) {   12313   if (s_trace_conflict_set_bm) {
12233     vgPlain_message((VgMsgKind )2, "[%d] updated conflict set:\n", tid);   12314     vgPlain_message((VgMsgKind )2, "[%d] updated conflict set:\n", tid);
12234     vgDrd_bm_print((struct bitmap */* const  */)vgDrd_g_conflict_set);   12315     vgDrd_bm_print((struct bitmap */* const  */)vgDrd_g_conflict_set);
12235     vgPlain_message((VgMsgKind )2, "[%d] end of updated conflict set.\n", tid);   12316     vgPlain_message((VgMsgKind )2, "[%d] end of updated conflict set.\n", tid);
12236   } else {   12317   } else {
12237     12318  
12238   }   12319   }
12239   tmp___31 = thread_conflict_set_up_to_date((DrdThreadId const   )vgDrd_g_drd_running_tid);   12320   tmp___31 = thread_conflict_set_up_to_date((DrdThreadId const   )vgDrd_g_drd_running_tid);
12240   if (tmp___31) {   12321   if (tmp___31) {
12241     tmp___32 = 1;   12322     tmp___32 = 1;
12242   } else {   12323   } else {
12243     tmp___32 = 0;   12324     tmp___32 = 0;
12244   }   12325   }
12245   tmp___33 = __builtin_expect((long )tmp___32, 1L);   12326   tmp___33 = __builtin_expect((long )tmp___32, 1L);
12246   if (tmp___33) {   12327   if (tmp___33) {
12247     12328  
12248   } else {   12329   } else {
12249     vgPlain_assert_fail((Bool )0,   12330     vgPlain_assert_fail((Bool )0,
12250                         (Char const   *)"thread_conflict_set_up_to_date(DRD_(g_drd_running_tid))",   12331                         (Char const   *)"thread_conflict_set_up_to_date(DRD_(g_drd_running_tid))",
12251                         (Char const   *)"drd_thread.c", 1576,   12332                         (Char const   *)"drd_thread.c", 1576,
12252                         (Char const   *)"vgDrd_thread_update_conflict_set", "");   12333                         (Char const   *)"vgDrd_thread_update_conflict_set", "");
12253   }   12334   }
12254   return;   12335   return;
12255 }   12336 }
12256 }   12337 }
12257 ULong vgDrd_thread_get_context_switch_count(void)   12338 ULong vgDrd_thread_get_context_switch_count(void)
12258 {   12339 {
12259     12340  
12260     12341  
12261   {   12342   {
12262   return (s_context_switch_count);   12343   return (s_context_switch_count);
12263 }   12344 }
12264 }   12345 }
12265 ULong vgDrd_thread_get_discard_ordered_segments_count(void)   12346 ULong vgDrd_thread_get_discard_ordered_segments_count(void)
12266 {   12347 {
12267     12348  
12268     12349  
12269   {   12350   {
12270   return (s_discard_ordered_segments_count);   12351   return (s_discard_ordered_segments_count);
12271 }   12352 }
12272 }   12353 }
12273 ULong vgDrd_thread_get_compute_conflict_set_count(void)   12354 ULong vgDrd_thread_get_compute_conflict_set_count(void)
12274 {   12355 {
12275     12356  
12276     12357  
12277   {   12358   {
12278   return (s_compute_conflict_set_count);   12359   return (s_compute_conflict_set_count);
12279 }   12360 }
12280 }   12361 }
12281 ULong vgDrd_thread_get_update_conflict_set_count(void)   12362 ULong vgDrd_thread_get_update_conflict_set_count(void)
12282 {   12363 {
12283     12364  
12284     12365  
12285   {   12366   {
12286   return (s_update_conflict_set_count);   12367   return (s_update_conflict_set_count);
12287 }   12368 }
12288 }   12369 }
12289 ULong vgDrd_thread_get_update_conflict_set_new_sg_count(void)   12370 ULong vgDrd_thread_get_update_conflict_set_new_sg_count(void)
12290 {   12371 {
12291     12372  
12292     12373  
12293   {   12374   {
12294   return (s_update_conflict_set_new_sg_count);   12375   return (s_update_conflict_set_new_sg_count);
12295 }   12376 }
12296 }   12377 }
12297 ULong vgDrd_thread_get_update_conflict_set_sync_count(void)   12378 ULong vgDrd_thread_get_update_conflict_set_sync_count(void)
12298 {   12379 {
12299     12380  
12300     12381  
12301   {   12382   {
12302   return (s_update_conflict_set_sync_count);   12383   return (s_update_conflict_set_sync_count);
12303 }   12384 }
12304 }   12385 }
12305 ULong vgDrd_thread_get_update_conflict_set_join_count(void)   12386 ULong vgDrd_thread_get_update_conflict_set_join_count(void)
12306 {   12387 {
12307     12388  
12308     12389  
12309   {   12390   {
12310   return (s_update_conflict_set_join_count);   12391   return (s_update_conflict_set_join_count);
12311 }   12392 }
12312 }   12393 }
12313 ULong vgDrd_thread_get_conflict_set_bitmap_creation_count(void)   12394 ULong vgDrd_thread_get_conflict_set_bitmap_creation_count(void)
12314 {   12395 {
12315     12396  
12316     12397  
12317   {   12398   {
12318   return (s_conflict_set_bitmap_creation_count);   12399   return (s_conflict_set_bitmap_creation_count);
12319 }   12400 }
12320 }   12401 }
12321 ULong vgDrd_thread_get_conflict_set_bitmap2_creation_count(void)   12402 ULong vgDrd_thread_get_conflict_set_bitmap2_creation_count(void)
12322 {   12403 {
12323     12404  
12324     12405  
12325   {   12406   {
12326   return (s_conflict_set_bitmap2_creation_count);   12407   return (s_conflict_set_bitmap2_creation_count);
12327 }   12408 }
12328 }   12409 }
12329 static void vgDrd_vc_reserve(VectorClock * const  vc ,   12410 static void vgDrd_vc_reserve(VectorClock * const  vc ,
12330                              unsigned int const   new_capacity ) ;   12411                              unsigned int const   new_capacity ) ;
12331 void vgDrd_vc_init(VectorClock * const  vc , VCElem const   * const  vcelem ,   12412 void vgDrd_vc_init(VectorClock * const  vc , VCElem const   * const  vcelem ,
12332                    unsigned int const   size )   12413                    unsigned int const   size )
12333 {   12414 {
12334   long tmp ;   12415   long tmp ;
12335   int tmp___0 ;   12416   int tmp___0 ;
12336   long tmp___1 ;   12417   long tmp___1 ;
12337     12418  
12338   {   12419   {
12339   tmp = __builtin_expect((long )(! (! vc)), 1L);   12420   tmp = __builtin_expect((long )(! (! vc)), 1L);
12340   if (tmp) {   12421   if (tmp) {
12341     12422  
12342   } else {   12423   } else {
12343     vgPlain_assert_fail((Bool )0, (Char const   *)"vc",   12424     vgPlain_assert_fail((Bool )0, (Char const   *)"vc",
12344                         (Char const   *)"drd_vc.c", 50,   12425                         (Char const   *)"drd_vc.c", 50,
12345                         (Char const   *)"vgDrd_vc_init", "");   12426                         (Char const   *)"vgDrd_vc_init", "");
12346   }   12427   }
12347   vc->size = 0U;   12428   vc->size = 0U;
12348   vc->capacity = 0U;   12429   vc->capacity = 0U;
12349   vc->vc = (VCElem *)0;   12430   vc->vc = (VCElem *)0;
12350   vgDrd_vc_reserve(vc, size);   12431   vgDrd_vc_reserve(vc, size);
12351   if (size == 0U) {   12432   if (size == 0U) {
12352     tmp___0 = 1;   12433     tmp___0 = 1;
12353   } else   12434   } else
12354   if ((unsigned int )vc->vc != (unsigned int )((VCElem *)0)) {   12435   if ((unsigned int )vc->vc != (unsigned int )((VCElem *)0)) {
12355     tmp___0 = 1;   12436     tmp___0 = 1;
12356   } else {   12437   } else {
12357     tmp___0 = 0;   12438     tmp___0 = 0;
12358   }   12439   }
12359   tmp___1 = __builtin_expect((long )tmp___0, 1L);   12440   tmp___1 = __builtin_expect((long )tmp___0, 1L);
12360   if (tmp___1) {   12441   if (tmp___1) {
12361     12442  
12362   } else {   12443   } else {
12363     vgPlain_assert_fail((Bool )0, (Char const   *)"size == 0 || vc->vc != 0",   12444     vgPlain_assert_fail((Bool )0, (Char const   *)"size == 0 || vc->vc != 0",
12364                         (Char const   *)"drd_vc.c", 55,   12445                         (Char const   *)"drd_vc.c", 55,
12365                         (Char const   *)"vgDrd_vc_init", "");   12446                         (Char const   *)"vgDrd_vc_init", "");
12366   }   12447   }
12367   if (vcelem) {   12448   if (vcelem) {
12368     vgPlain_memcpy((void *)vc->vc, (void const   *)vcelem,   12449     vgPlain_memcpy((void *)vc->vc, (void const   *)vcelem,
12369                    (SizeT )(size * (unsigned int const   )sizeof(*(vcelem + 0))));   12450                    (SizeT )(size * (unsigned int const   )sizeof(*(vcelem + 0))));
12370     vc->size = (unsigned int )size;   12451     vc->size = (unsigned int )size;
12371   } else {   12452   } else {
12372     12453  
12373   }   12454   }
12374   return;   12455   return;
12375 }   12456 }
12376 }   12457 }
12377 void vgDrd_vc_cleanup(VectorClock * const  vc )   12458 void vgDrd_vc_cleanup(VectorClock * const  vc )
12378 {   12459 {
12379     12460  
12380     12461  
12381   {   12462   {
12382   vgDrd_vc_reserve(vc, (unsigned int const   )0);   12463   vgDrd_vc_reserve(vc, (unsigned int const   )0);
12383   return;   12464   return;
12384 }   12465 }
12385 }   12466 }
12386 void vgDrd_vc_copy(VectorClock * const  new , VectorClock const   * const  rhs )   12467 void vgDrd_vc_copy(VectorClock * const  new , VectorClock const   * const  rhs )
12387 {   12468 {
12388     12469  
12389     12470  
12390   {   12471   {
12391   vgDrd_vc_init(new, (VCElem const   */* const  */)rhs->vc, rhs->size);   12472   vgDrd_vc_init(new, (VCElem const   */* const  */)rhs->vc, rhs->size);
12392   return;   12473   return;
12393 }   12474 }
12394 }   12475 }
12395 void vgDrd_vc_assign(VectorClock * const  lhs ,   12476 void vgDrd_vc_assign(VectorClock * const  lhs ,
12396                      VectorClock const   * const  rhs )   12477                      VectorClock const   * const  rhs )
12397 {   12478 {
12398     12479  
12399     12480  
12400   {   12481   {
12401   vgDrd_vc_cleanup(lhs);   12482   vgDrd_vc_cleanup(lhs);
12402   vgDrd_vc_copy(lhs, rhs);   12483   vgDrd_vc_copy(lhs, rhs);
12403   return;   12484   return;
12404 }   12485 }
12405 }   12486 }
12406 void vgDrd_vc_increment(VectorClock * const  vc , DrdThreadId const   tid )   12487 void vgDrd_vc_increment(VectorClock * const  vc , DrdThreadId const   tid )
12407 {   12488 {
12408   unsigned int i ;   12489   unsigned int i ;
12409   UInt oldcount ;   12490   UInt oldcount ;
12410   long tmp ;   12491   long tmp ;
12411   VCElem vcelem ;   12492   VCElem vcelem ;
12412   VectorClock vc2 ;   12493   VectorClock vc2 ;
12413     12494  
12414   {   12495   {
12415   i = 0U;   12496   i = 0U;
12416   while (i < vc->size) {   12497   while (i < vc->size) {
12417     if ((vc->vc + i)->threadid == (DrdThreadId )tid) {   12498     if ((vc->vc + i)->threadid == (DrdThreadId )tid) {
12418       oldcount = (vc->vc + i)->count;   12499       oldcount = (vc->vc + i)->count;
12419       ((vc->vc + i)->count) ++;   12500       ((vc->vc + i)->count) ++;
12420       tmp = __builtin_expect((long )(! (! (oldcount < (vc->vc + i)->count))), 1L);   12501       tmp = __builtin_expect((long )(! (! (oldcount < (vc->vc + i)->count))), 1L);
12421       if (tmp) {   12502       if (tmp) {
12422     12503  
12423       } else {   12504       } else {
12424         vgPlain_assert_fail((Bool )0,   12505         vgPlain_assert_fail((Bool )0,
12425                             (Char const   *)"oldcount < vc->vc[i].count",   12506                             (Char const   *)"oldcount < vc->vc[i].count",
12426                             (Char const   *)"drd_vc.c", 93,   12507                             (Char const   *)"drd_vc.c", 93,
12427                             (Char const   *)"vgDrd_vc_increment", "");   12508                             (Char const   *)"vgDrd_vc_increment", "");
12428       }   12509       }
12429       return;   12510       return;
12430     } else {   12511     } else {
12431     12512  
12432     }   12513     }
12433     i ++;   12514     i ++;
12434   }   12515   }
12435   vcelem.threadid = (DrdThreadId )tid;   12516   vcelem.threadid = (DrdThreadId )tid;
12436   vcelem.count = (UInt )1;   12517   vcelem.count = (UInt )1;
12437   vgDrd_vc_init((VectorClock */* const  */)(& vc2),   12518   vgDrd_vc_init((VectorClock */* const  */)(& vc2),
12438                 (VCElem const   */* const  */)(& vcelem),   12519                 (VCElem const   */* const  */)(& vcelem),
12439                 (unsigned int const   )1);   12520                 (unsigned int const   )1);
12440   vgDrd_vc_combine(vc, (VectorClock const   */* const  */)(& vc2));   12521   vgDrd_vc_combine(vc, (VectorClock const   */* const  */)(& vc2));
12441   vgDrd_vc_cleanup((VectorClock */* const  */)(& vc2));   12522   vgDrd_vc_cleanup((VectorClock */* const  */)(& vc2));
12442   return;   12523   return;
12443 }   12524 }
12444 }   12525 }
12445 Bool vgDrd_vc_ordered(VectorClock const   * const  vc1 ,   12526 Bool vgDrd_vc_ordered(VectorClock const   * const  vc1 ,
12446                       VectorClock const   * const  vc2 )   12527                       VectorClock const   * const  vc2 )
12447 {   12528 {
12448   Bool tmp ;   12529   Bool tmp ;
12449   Bool tmp___0 ;   12530   Bool tmp___0 ;
12450   int tmp___1 ;   12531   int tmp___1 ;
12451     12532  
12452   {   12533   {
12453   tmp = vgDrd_vc_lte(vc1, vc2);   12534   tmp = vgDrd_vc_lte(vc1, vc2);
12454   if (tmp) {   12535   if (tmp) {
12455     tmp___1 = 1;   12536     tmp___1 = 1;
12456   } else {   12537   } else {
12457     tmp___0 = vgDrd_vc_lte(vc2, vc1);   12538     tmp___0 = vgDrd_vc_lte(vc2, vc1);
12458     if (tmp___0) {   12539     if (tmp___0) {
12459       tmp___1 = 1;   12540       tmp___1 = 1;
12460     } else {   12541     } else {
12461       tmp___1 = 0;   12542       tmp___1 = 0;
12462     }   12543     }
12463   }   12544   }
12464   return ((Bool )tmp___1);   12545   return ((Bool )tmp___1);
12465 }   12546 }
12466 }   12547 }
12467 void vgDrd_vc_min(VectorClock * const  result ,   12548 void vgDrd_vc_min(VectorClock * const  result ,
12468                   VectorClock const   * const  rhs )   12549                   VectorClock const   * const  rhs )
12469 {   12550 {
12470   unsigned int i ;   12551   unsigned int i ;
12471   unsigned int j ;   12552   unsigned int j ;
12472   long tmp ;   12553   long tmp ;
12473   long tmp___0 ;   12554   long tmp___0 ;
12474   long tmp___1 ;   12555   long tmp___1 ;
12475     12556  
12476   {   12557   {
12477   tmp = __builtin_expect((long )(! (! result)), 1L);   12558   tmp = __builtin_expect((long )(! (! result)), 1L);
12478   if (tmp) {   12559   if (tmp) {
12479     12560  
12480   } else {   12561   } else {
12481     vgPlain_assert_fail((Bool )0, (Char const   *)"result",   12562     vgPlain_assert_fail((Bool )0, (Char const   *)"result",
12482                         (Char const   *)"drd_vc.c", 127,   12563                         (Char const   *)"drd_vc.c", 127,
12483                         (Char const   *)"vgDrd_vc_min", "");   12564                         (Char const   *)"vgDrd_vc_min", "");
12484   }   12565   }
12485   tmp___0 = __builtin_expect((long )(! (! rhs)), 1L);   12566   tmp___0 = __builtin_expect((long )(! (! rhs)), 1L);
12486   if (tmp___0) {   12567   if (tmp___0) {
12487     12568  
12488   } else {   12569   } else {
12489     vgPlain_assert_fail((Bool )0, (Char const   *)"rhs",   12570     vgPlain_assert_fail((Bool )0, (Char const   *)"rhs",
12490                         (Char const   *)"drd_vc.c", 128,   12571                         (Char const   *)"drd_vc.c", 128,
12491                         (Char const   *)"vgDrd_vc_min", "");   12572                         (Char const   *)"vgDrd_vc_min", "");
12492   }   12573   }
12493   vgDrd_vc_check((VectorClock const   */* const  */)result);   12574   vgDrd_vc_check((VectorClock const   */* const  */)result);
12494   i = 0U;   12575   i = 0U;
12495   j = 0U;   12576   j = 0U;
12496   while (j < (unsigned int )rhs->size) {   12577   while (j < (unsigned int )rhs->size) {
12497     while (1) {   12578     while (1) {
12498       if (i < result->size) {   12579       if (i < result->size) {
12499         if ((result->vc + i)->threadid < (rhs->vc + j)->threadid) {   12580         if ((result->vc + i)->threadid < (rhs->vc + j)->threadid) {
12500     12581  
12501         } else {   12582         } else {
12502           break;   12583           break;
12503         }   12584         }
12504       } else {   12585       } else {
12505         break;   12586         break;
12506       }   12587       }
12507       (result->vc + i)->count = (UInt )0;   12588       (result->vc + i)->count = (UInt )0;
12508       i ++;   12589       i ++;
12509     }   12590     }
12510     if (i >= result->size) {   12591     if (i >= result->size) {
12511       break;   12592       break;
12512     } else {   12593     } else {
12513     12594  
12514     }   12595     }
12515     if ((result->vc + i)->threadid <= (rhs->vc + j)->threadid) {   12596     if ((result->vc + i)->threadid <= (rhs->vc + j)->threadid) {
12516       tmp___1 = __builtin_expect((long )(! (! ((result->vc + i)->threadid == (rhs->vc + j)->threadid))),   12597       tmp___1 = __builtin_expect((long )(! (! ((result->vc + i)->threadid == (rhs->vc + j)->threadid))),
12517                                  1L);   12598                                  1L);
12518       if (tmp___1) {   12599       if (tmp___1) {
12519     12600  
12520       } else {   12601       } else {
12521         vgPlain_assert_fail((Bool )0,   12602         vgPlain_assert_fail((Bool )0,
12522                             (Char const   *)"result->vc[i].threadid == rhs->vc[j].threadid",   12603                             (Char const   *)"result->vc[i].threadid == rhs->vc[j].threadid",
12523                             (Char const   *)"drd_vc.c", 150,   12604                             (Char const   *)"drd_vc.c", 150,
12524                             (Char const   *)"vgDrd_vc_min", "");   12605                             (Char const   *)"vgDrd_vc_min", "");
12525       }   12606       }
12526       if ((rhs->vc + j)->count < (result->vc + i)->count) {   12607       if ((rhs->vc + j)->count < (result->vc + i)->count) {
12527         (result->vc + i)->count = (rhs->vc + j)->count;   12608         (result->vc + i)->count = (rhs->vc + j)->count;
12528       } else {   12609       } else {
12529     12610  
12530       }   12611       }
12531     } else {   12612     } else {
12532     12613  
12533     }   12614     }
12534     j ++;   12615     j ++;
12535   }   12616   }
12536   vgDrd_vc_check((VectorClock const   */* const  */)result);   12617   vgDrd_vc_check((VectorClock const   */* const  */)result);
12537   return;   12618   return;
12538 }   12619 }
12539 }   12620 }
12540 void vgDrd_vc_combine(VectorClock * const  result ,   12621 void vgDrd_vc_combine(VectorClock * const  result ,
12541                       VectorClock const   * const  rhs )   12622                       VectorClock const   * const  rhs )
12542 {   12623 {
12543   unsigned int i ;   12624   unsigned int i ;
12544   unsigned int j ;   12625   unsigned int j ;
12545   unsigned int shared ;   12626   unsigned int shared ;
12546   unsigned int new_size ;   12627   unsigned int new_size ;
12547   long tmp ;   12628   long tmp ;
12548   long tmp___0 ;   12629   long tmp___0 ;
12549   unsigned int k ;   12630   unsigned int k ;
12550   long tmp___1 ;   12631   long tmp___1 ;
12551   long tmp___2 ;   12632   long tmp___2 ;
12552     12633  
12553   {   12634   {
12554   tmp = __builtin_expect((long )(! (! result)), 1L);   12635   tmp = __builtin_expect((long )(! (! result)), 1L);
12555   if (tmp) {   12636   if (tmp) {
12556     12637  
12557   } else {   12638   } else {
12558     vgPlain_assert_fail((Bool )0, (Char const   *)"result",   12639     vgPlain_assert_fail((Bool )0, (Char const   *)"result",
12559                         (Char const   *)"drd_vc.c", 170,   12640                         (Char const   *)"drd_vc.c", 170,
12560                         (Char const   *)"vgDrd_vc_combine", "");   12641                         (Char const   *)"vgDrd_vc_combine", "");
12561   }   12642   }
12562   tmp___0 = __builtin_expect((long )(! (! rhs)), 1L);   12643   tmp___0 = __builtin_expect((long )(! (! rhs)), 1L);
12563   if (tmp___0) {   12644   if (tmp___0) {
12564     12645  
12565   } else {   12646   } else {
12566     vgPlain_assert_fail((Bool )0, (Char const   *)"rhs",   12647     vgPlain_assert_fail((Bool )0, (Char const   *)"rhs",
12567                         (Char const   *)"drd_vc.c", 171,   12648                         (Char const   *)"drd_vc.c", 171,
12568                         (Char const   *)"vgDrd_vc_combine", "");   12649                         (Char const   *)"vgDrd_vc_combine", "");
12569   }   12650   }
12570   j = 0U;   12651   j = 0U;
12571   shared = 0U;   12652   shared = 0U;
12572   i = 0U;   12653   i = 0U;
12573   while (i < result->size) {   12654   while (i < result->size) {
12574     while (1) {   12655     while (1) {
12575       if (j < (unsigned int )rhs->size) {   12656       if (j < (unsigned int )rhs->size) {
12576         if ((rhs->vc + j)->threadid < (result->vc + i)->threadid) {   12657         if ((rhs->vc + j)->threadid < (result->vc + i)->threadid) {
12577     12658  
12578         } else {   12659         } else {
12579           break;   12660           break;
12580         }   12661         }
12581       } else {   12662       } else {
12582         break;   12663         break;
12583       }   12664       }
12584       j ++;   12665       j ++;
12585     }   12666     }
12586     if (j >= (unsigned int )rhs->size) {   12667     if (j >= (unsigned int )rhs->size) {
12587       break;   12668       break;
12588     } else {   12669     } else {
12589     12670  
12590     }   12671     }
12591     if ((result->vc + i)->threadid == (rhs->vc + j)->threadid) {   12672     if ((result->vc + i)->threadid == (rhs->vc + j)->threadid) {
12592       shared ++;   12673       shared ++;
12593     } else {   12674     } else {
12594     12675  
12595     }   12676     }
12596     i ++;   12677     i ++;
12597   }   12678   }
12598   vgDrd_vc_check((VectorClock const   */* const  */)result);   12679   vgDrd_vc_check((VectorClock const   */* const  */)result);
12599   new_size = (result->size + (unsigned int )rhs->size) - shared;   12680   new_size = (result->size + (unsigned int )rhs->size) - shared;
12600   if (new_size > result->capacity) {   12681   if (new_size > result->capacity) {
12601     vgDrd_vc_reserve(result, (unsigned int const   )new_size);   12682     vgDrd_vc_reserve(result, (unsigned int const   )new_size);
12602   } else {   12683   } else {
12603     12684  
12604   }   12685   }
12605   vgDrd_vc_check((VectorClock const   */* const  */)result);   12686   vgDrd_vc_check((VectorClock const   */* const  */)result);
12606   i = 0U;   12687   i = 0U;
12607   j = 0U;   12688   j = 0U;
12608   while (j < (unsigned int )rhs->size) {   12689   while (j < (unsigned int )rhs->size) {
12609     while (1) {   12690     while (1) {
12610       if (i < result->size) {   12691       if (i < result->size) {
12611         if ((result->vc + i)->threadid < (rhs->vc + j)->threadid) {   12692         if ((result->vc + i)->threadid < (rhs->vc + j)->threadid) {
12612     12693  
12613         } else {   12694         } else {
12614           break;   12695           break;
12615         }   12696         }
12616       } else {   12697       } else {
12617         break;   12698         break;
12618       }   12699       }
12619       i ++;   12700       i ++;
12620     }   12701     }
12621     if (i >= result->size) {   12702     if (i >= result->size) {
12622       (result->size) ++;   12703       (result->size) ++;
12623       *(result->vc + i) = *(rhs->vc + j);   12704       *(result->vc + i) = *(rhs->vc + j);
12624     } else   12705     } else
12625     if ((result->vc + i)->threadid > (rhs->vc + j)->threadid) {   12706     if ((result->vc + i)->threadid > (rhs->vc + j)->threadid) {
12626       k = result->size;   12707       k = result->size;
12627       while (k > i) {   12708       while (k > i) {
12628         *(result->vc + k) = *(result->vc + (k - 1U));   12709         *(result->vc + k) = *(result->vc + (k - 1U));
12629         k --;   12710         k --;
12630       }   12711       }
12631       (result->size) ++;   12712       (result->size) ++;
12632       *(result->vc + i) = *(rhs->vc + j);   12713       *(result->vc + i) = *(rhs->vc + j);
12633     } else {   12714     } else {
12634       tmp___1 = __builtin_expect((long )(! (! ((result->vc + i)->threadid == (rhs->vc + j)->threadid))),   12715       tmp___1 = __builtin_expect((long )(! (! ((result->vc + i)->threadid == (rhs->vc + j)->threadid))),
12635                                  1L);   12716                                  1L);
12636       if (tmp___1) {   12717       if (tmp___1) {
12637     12718  
12638       } else {   12719       } else {
12639         vgPlain_assert_fail((Bool )0,   12720         vgPlain_assert_fail((Bool )0,
12640                             (Char const   *)"result->vc[i].threadid == rhs->vc[j].threadid",   12721                             (Char const   *)"result->vc[i].threadid == rhs->vc[j].threadid",
12641                             (Char const   *)"drd_vc.c", 225,   12722                             (Char const   *)"drd_vc.c", 225,
12642                             (Char const   *)"vgDrd_vc_combine", "");   12723                             (Char const   *)"vgDrd_vc_combine", "");
12643       }   12724       }
12644       if ((rhs->vc + j)->count > (result->vc + i)->count) {   12725       if ((rhs->vc + j)->count > (result->vc + i)->count) {
12645         (result->vc + i)->count = (rhs->vc + j)->count;   12726         (result->vc + i)->count = (rhs->vc + j)->count;
12646       } else {   12727       } else {
12647     12728  
12648       }   12729       }
12649     }   12730     }
12650     j ++;   12731     j ++;
12651   }   12732   }
12652   vgDrd_vc_check((VectorClock const   */* const  */)result);   12733   vgDrd_vc_check((VectorClock const   */* const  */)result);
12653   tmp___2 = __builtin_expect((long )(! (! (result->size == new_size))), 1L);   12734   tmp___2 = __builtin_expect((long )(! (! (result->size == new_size))), 1L);
12654   if (tmp___2) {   12735   if (tmp___2) {
12655     12736  
12656   } else {   12737   } else {
12657     vgPlain_assert_fail((Bool )0, (Char const   *)"result->size == new_size",   12738     vgPlain_assert_fail((Bool )0, (Char const   *)"result->size == new_size",
12658                         (Char const   *)"drd_vc.c", 233,   12739                         (Char const   *)"drd_vc.c", 233,
12659                         (Char const   *)"vgDrd_vc_combine", "");   12740                         (Char const   *)"vgDrd_vc_combine", "");
12660   }   12741   }
12661   return;   12742   return;
12662 }   12743 }
12663 }   12744 }
12664 void vgDrd_vc_print(VectorClock const   * const  vc )   12745 void vgDrd_vc_print(VectorClock const   * const  vc )
12665 {   12746 {
12666   char *str ;   12747   char *str ;
12667     12748  
12668   {   12749   {
12669   str = vgDrd_vc_aprint(vc);   12750   str = vgDrd_vc_aprint(vc);
12670   if ((unsigned int )str != (unsigned int )((void *)0)) {   12751   if ((unsigned int )str != (unsigned int )((void *)0)) {
12671     vgPlain_printf("%s", str);   12752     vgPlain_printf("%s", str);
12672     vgPlain_free((void *)str);   12753     vgPlain_free((void *)str);
12673   } else {   12754   } else {
12674     12755  
12675   }   12756   }
12676   return;   12757   return;
12677 }   12758 }
12678 }   12759 }
12679 char *vgDrd_vc_aprint(VectorClock const   * const  vc )   12760 char *vgDrd_vc_aprint(VectorClock const   * const  vc )
12680 {   12761 {
12681   unsigned int i ;   12762   unsigned int i ;
12682   unsigned int reserved ;   12763   unsigned int reserved ;
12683   unsigned int size ;   12764   unsigned int size ;
12684   char *str ;   12765   char *str ;
12685   long tmp ;   12766   long tmp ;
12686   void *tmp___0 ;   12767   void *tmp___0 ;
12687   UInt tmp___1 ;   12768   UInt tmp___1 ;
12688   long tmp___2 ;   12769   long tmp___2 ;
12689   void *tmp___3 ;   12770   void *tmp___3 ;
12690   SizeT tmp___4 ;   12771   SizeT tmp___4 ;
12691   char const   *tmp___5 ;   12772   char const   *tmp___5 ;
12692   UInt tmp___6 ;   12773   UInt tmp___6 ;
12693   UInt tmp___7 ;   12774   UInt tmp___7 ;
12694     12775  
12695   {   12776   {
12696   str = (char *)0;   12777   str = (char *)0;
12697   tmp = __builtin_expect((long )(! (! vc)), 1L);   12778   tmp = __builtin_expect((long )(! (! vc)), 1L);
12698   if (tmp) {   12779   if (tmp) {
12699     12780  
12700   } else {   12781   } else {
12701     vgPlain_assert_fail((Bool )0, (Char const   *)"vc",   12782     vgPlain_assert_fail((Bool )0, (Char const   *)"vc",
12702                         (Char const   *)"drd_vc.c", 259,   12783                         (Char const   *)"drd_vc.c", 259,
12703                         (Char const   *)"vgDrd_vc_aprint", "");   12784                         (Char const   *)"vgDrd_vc_aprint", "");
12704   }   12785   }
12705   reserved = 64U;   12786   reserved = 64U;
12706   size = 0U;   12787   size = 0U;
12707   tmp___0 = vgPlain_realloc((HChar *)"drd.vc.aprint.1", (void *)str,   12788   tmp___0 = vgPlain_realloc((HChar *)"drd.vc.aprint.1", (void *)str,
12708                             (SizeT )reserved);   12789                             (SizeT )reserved);
12709   str = (char *)tmp___0;   12790   str = (char *)tmp___0;
12710   if (! str) {   12791   if (! str) {
12711     return (str);   12792     return (str);
12712   } else {   12793   } else {
12713     12794  
12714   }   12795   }
12715   tmp___1 = vgPlain_snprintf((Char *)str, (Int )reserved, "[");   12796   tmp___1 = vgPlain_snprintf((Char *)str, (Int )reserved, "[");
12716   size += tmp___1;   12797   size += tmp___1;
12717   i = 0U;   12798   i = 0U;
12718   while (i < (unsigned int )vc->size) {   12799   while (i < (unsigned int )vc->size) {
12719     tmp___2 = __builtin_expect((long )(! (! vc->vc)), 1L);   12800     tmp___2 = __builtin_expect((long )(! (! vc->vc)), 1L);
12720     if (tmp___2) {   12801     if (tmp___2) {
12721     12802  
12722     } else {   12803     } else {
12723       vgPlain_assert_fail((Bool )0, (Char const   *)"vc->vc",   12804       vgPlain_assert_fail((Bool )0, (Char const   *)"vc->vc",
12724                           (Char const   *)"drd_vc.c", 268,   12805                           (Char const   *)"drd_vc.c", 268,
12725                           (Char const   *)"vgDrd_vc_aprint", "");   12806                           (Char const   *)"vgDrd_vc_aprint", "");
12726     }   12807     }
12727     tmp___4 = vgPlain_strlen((Char const   *)str);   12808     tmp___4 = vgPlain_strlen((Char const   *)str);
12728     if (tmp___4 + 32UL > (SizeT )reserved) {   12809     if (tmp___4 + 32UL > (SizeT )reserved) {
12729       reserved *= 2U;   12810       reserved *= 2U;
12730       tmp___3 = vgPlain_realloc((HChar *)"drd.vc.aprint.2", (void *)str,   12811       tmp___3 = vgPlain_realloc((HChar *)"drd.vc.aprint.2", (void *)str,
12731                                 (SizeT )reserved);   12812                                 (SizeT )reserved);
12732       str = (char *)tmp___3;   12813       str = (char *)tmp___3;
12733       if (! str) {   12814       if (! str) {
12734         return (str);   12815         return (str);
12735       } else {   12816       } else {
12736     12817  
12737       }   12818       }
12738     } else {   12819     } else {
12739     12820  
12740     }   12821     }
12741     if (i > 0U) {   12822     if (i > 0U) {
12742       tmp___5 = ",";   12823       tmp___5 = ",";
12743     } else {   12824     } else {
12744       tmp___5 = "";   12825       tmp___5 = "";
12745     }   12826     }
12746     tmp___6 = vgPlain_snprintf((Char *)(str + size), (Int )(reserved - size),   12827     tmp___6 = vgPlain_snprintf((Char *)(str + size), (Int )(reserved - size),
12747                                "%s %d: %d", tmp___5, (vc->vc + i)->threadid,   12828                                "%s %d: %d", tmp___5, (vc->vc + i)->threadid,
12748                                (vc->vc + i)->count);   12829                                (vc->vc + i)->count);
12749     size += tmp___6;   12830     size += tmp___6;
12750     i ++;   12831     i ++;
12751   }   12832   }
12752   tmp___7 = vgPlain_snprintf((Char *)(str + size), (Int )(reserved - size), " ]");   12833   tmp___7 = vgPlain_snprintf((Char *)(str + size), (Int )(reserved - size), " ]");
12753   size += tmp___7;   12834   size += tmp___7;
12754   return (str);   12835   return (str);
12755 }   12836 }
12756 }   12837 }
12757 void vgDrd_vc_check(VectorClock const   * const  vc )   12838 void vgDrd_vc_check(VectorClock const   * const  vc )
12758 {   12839 {
12759   unsigned int i ;   12840   unsigned int i ;
12760   long tmp ;   12841   long tmp ;
12761   long tmp___0 ;   12842   long tmp___0 ;
12762     12843  
12763   {   12844   {
12764   tmp = __builtin_expect((long )(! (! (vc->size <= vc->capacity))), 1L);   12845   tmp = __builtin_expect((long )(! (! (vc->size <= vc->capacity))), 1L);
12765   if (tmp) {   12846   if (tmp) {
12766     12847  
12767   } else {   12848   } else {
12768     vgPlain_assert_fail((Bool )0, (Char const   *)"vc->size <= vc->capacity",   12849     vgPlain_assert_fail((Bool )0, (Char const   *)"vc->size <= vc->capacity",
12769                         (Char const   *)"drd_vc.c", 298,   12850                         (Char const   *)"drd_vc.c", 298,
12770                         (Char const   *)"vgDrd_vc_check", "");   12851                         (Char const   *)"vgDrd_vc_check", "");
12771   }   12852   }
12772   i = 1U;   12853   i = 1U;
12773   while (i < (unsigned int )vc->size) {   12854   while (i < (unsigned int )vc->size) {
12774     tmp___0 = __builtin_expect((long )(! (! ((vc->vc + (i - 1U))->threadid < (vc->vc + i)->threadid))),   12855     tmp___0 = __builtin_expect((long )(! (! ((vc->vc + (i - 1U))->threadid < (vc->vc + i)->threadid))),
12775                                1L);   12856                                1L);
12776     if (tmp___0) {   12857     if (tmp___0) {
12777     12858  
12778     } else {   12859     } else {
12779       vgPlain_assert_fail((Bool )0,   12860       vgPlain_assert_fail((Bool )0,
12780                           (Char const   *)"vc->vc[i-1].threadid < vc->vc[i].threadid",   12861                           (Char const   *)"vc->vc[i-1].threadid < vc->vc[i].threadid",
12781                           (Char const   *)"drd_vc.c", 301,   12862                           (Char const   *)"drd_vc.c", 301,
12782                           (Char const   *)"vgDrd_vc_check", "");   12863                           (Char const   *)"vgDrd_vc_check", "");
12783     }   12864     }
12784     i ++;   12865     i ++;
12785   }   12866   }
12786   return;   12867   return;
12787 }   12868 }
12788 }   12869 }
12789 static void vgDrd_vc_reserve(VectorClock * const  vc ,   12870 static void vgDrd_vc_reserve(VectorClock * const  vc ,
12790                              unsigned int const   new_capacity )   12871                              unsigned int const   new_capacity )
12791 {   12872 {
12792   long tmp ;   12873   long tmp ;
12793   int tmp___0 ;   12874   int tmp___0 ;
12794   long tmp___1 ;   12875   long tmp___1 ;
12795   int tmp___2 ;   12876   int tmp___2 ;
12796   long tmp___3 ;   12877   long tmp___3 ;
12797   void *tmp___4 ;   12878   void *tmp___4 ;
12798   int tmp___5 ;   12879   int tmp___5 ;
12799   long tmp___6 ;   12880   long tmp___6 ;
12800   void *tmp___7 ;   12881   void *tmp___7 ;
12801   int tmp___8 ;   12882   int tmp___8 ;
12802   long tmp___9 ;   12883   long tmp___9 ;
12803   int tmp___10 ;   12884   int tmp___10 ;
12804   long tmp___11 ;   12885   long tmp___11 ;
12805   void *tmp___12 ;   12886   void *tmp___12 ;
12806   int tmp___13 ;   12887   int tmp___13 ;
12807   long tmp___14 ;   12888   long tmp___14 ;
12808   int tmp___15 ;   12889   int tmp___15 ;
12809   long tmp___16 ;   12890   long tmp___16 ;
12810   int tmp___17 ;   12891   int tmp___17 ;
12811   long tmp___18 ;   12892   long tmp___18 ;
12812     12893  
12813   {   12894   {
12814   tmp = __builtin_expect((long )(! (! vc)), 1L);   12895   tmp = __builtin_expect((long )(! (! vc)), 1L);
12815   if (tmp) {   12896   if (tmp) {
12816     12897  
12817   } else {   12898   } else {
12818     vgPlain_assert_fail((Bool )0, (Char const   *)"vc",   12899     vgPlain_assert_fail((Bool )0, (Char const   *)"vc",
12819                         (Char const   *)"drd_vc.c", 313,   12900                         (Char const   *)"drd_vc.c", 313,
12820                         (Char const   *)"vgDrd_vc_reserve", "");   12901                         (Char const   *)"vgDrd_vc_reserve", "");
12821   }   12902   }
12822   if (vc->capacity > 8U) {   12903   if (vc->capacity > 8U) {
12823     tmp___0 = 1;   12904     tmp___0 = 1;
12824   } else   12905   } else
12825   if ((unsigned int )vc->vc == (unsigned int )((VCElem *)0)) {   12906   if ((unsigned int )vc->vc == (unsigned int )((VCElem *)0)) {
12826     tmp___0 = 1;   12907     tmp___0 = 1;
12827   } else   12908   } else
12828   if ((unsigned int )vc->vc == (unsigned int )(vc->preallocated)) {   12909   if ((unsigned int )vc->vc == (unsigned int )(vc->preallocated)) {
12829     tmp___0 = 1;   12910     tmp___0 = 1;
12830   } else {   12911   } else {
12831     tmp___0 = 0;   12912     tmp___0 = 0;
12832   }   12913   }
12833   tmp___1 = __builtin_expect((long )tmp___0, 1L);   12914   tmp___1 = __builtin_expect((long )tmp___0, 1L);
12834   if (tmp___1) {   12915   if (tmp___1) {
12835     12916  
12836   } else {   12917   } else {
12837     vgPlain_assert_fail((Bool )0,   12918     vgPlain_assert_fail((Bool )0,
12838                         (Char const   *)"vc->capacity > VC_PREALLOCATED || vc->vc == 0 || vc->vc == vc->preallocated",   12919                         (Char const   *)"vc->capacity > VC_PREALLOCATED || vc->vc == 0 || vc->vc == vc->preallocated",
12839                         (Char const   *)"drd_vc.c", 316,   12920                         (Char const   *)"drd_vc.c", 316,
12840                         (Char const   *)"vgDrd_vc_reserve", "");   12921                         (Char const   *)"vgDrd_vc_reserve", "");
12841   }   12922   }
12842   if (new_capacity > (unsigned int const   )vc->capacity) {   12923   if (new_capacity > (unsigned int const   )vc->capacity) {
12843     if (vc->vc) {   12924     if (vc->vc) {
12844       if (vc->capacity > 8U) {   12925       if (vc->capacity > 8U) {
12845         if (vc->vc) {   12926         if (vc->vc) {
12846           if ((unsigned int )vc->vc != (unsigned int )(vc->preallocated)) {   12927           if ((unsigned int )vc->vc != (unsigned int )(vc->preallocated)) {
12847             if (vc->capacity > 8U) {   12928             if (vc->capacity > 8U) {
12848               tmp___2 = 1;   12929               tmp___2 = 1;
12849             } else {   12930             } else {
12850               tmp___2 = 0;   12931               tmp___2 = 0;
12851             }   12932             }
12852           } else {   12933           } else {
12853             tmp___2 = 0;   12934             tmp___2 = 0;
12854           }   12935           }
12855         } else {   12936         } else {
12856           tmp___2 = 0;   12937           tmp___2 = 0;
12857         }   12938         }
12858         tmp___3 = __builtin_expect((long )tmp___2, 1L);   12939         tmp___3 = __builtin_expect((long )tmp___2, 1L);
12859         if (tmp___3) {   12940         if (tmp___3) {
12860     12941  
12861         } else {   12942         } else {
12862           vgPlain_assert_fail((Bool )0,   12943           vgPlain_assert_fail((Bool )0,
12863                               (Char const   *)"vc->vc && vc->vc != vc->preallocated && vc->capacity > VC_PREALLOCATED",   12944                               (Char const   *)"vc->vc && vc->vc != vc->preallocated && vc->capacity > VC_PREALLOCATED",
12864                               (Char const   *)"drd_vc.c", 324,   12945                               (Char const   *)"drd_vc.c", 324,
12865                               (Char const   *)"vgDrd_vc_reserve", "");   12946                               (Char const   *)"vgDrd_vc_reserve", "");
12866         }   12947         }
12867         tmp___4 = vgPlain_realloc((HChar *)"drd.vc.vr.1", (void *)vc->vc,   12948         tmp___4 = vgPlain_realloc((HChar *)"drd.vc.vr.1", (void *)vc->vc,
12868                                   (SizeT )(new_capacity * (unsigned int const   )sizeof(*(vc->vc + 0))));   12949                                   (SizeT )(new_capacity * (unsigned int const   )sizeof(*(vc->vc + 0))));
12869         vc->vc = (VCElem *)tmp___4;   12950         vc->vc = (VCElem *)tmp___4;
12870       } else {   12951       } else {
12871         goto _L___1;   12952         goto _L___1;
12872       }   12953       }
12873     } else   12954     } else
12874     _L___1: /* CIL Label */   12955     _L___1: /* CIL Label */
12875     if (vc->vc) {   12956     if (vc->vc) {
12876       if (new_capacity > 8U) {   12957       if (new_capacity > 8U) {
12877         if ((unsigned int )vc->vc == (unsigned int )((VCElem *)0)) {   12958         if ((unsigned int )vc->vc == (unsigned int )((VCElem *)0)) {
12878           goto _L;   12959           goto _L;
12879         } else   12960         } else
12880         if ((unsigned int )vc->vc == (unsigned int )(vc->preallocated)) {   12961         if ((unsigned int )vc->vc == (unsigned int )(vc->preallocated)) {
12881           _L: /* CIL Label */   12962           _L: /* CIL Label */
12882           if (new_capacity > 8U) {   12963           if (new_capacity > 8U) {
12883             if (vc->capacity <= 8U) {   12964             if (vc->capacity <= 8U) {
12884               tmp___5 = 1;   12965               tmp___5 = 1;
12885             } else {   12966             } else {
12886               tmp___5 = 0;   12967               tmp___5 = 0;
12887             }   12968             }
12888           } else {   12969           } else {
12889             tmp___5 = 0;   12970             tmp___5 = 0;
12890           }   12971           }
12891         } else {   12972         } else {
12892           tmp___5 = 0;   12973           tmp___5 = 0;
12893         }   12974         }
12894         tmp___6 = __builtin_expect((long )tmp___5, 1L);   12975         tmp___6 = __builtin_expect((long )tmp___5, 1L);
12895         if (tmp___6) {   12976         if (tmp___6) {
12896     12977  
12897         } else {   12978         } else {
12898           vgPlain_assert_fail((Bool )0,   12979           vgPlain_assert_fail((Bool )0,
12899                               (Char const   *)"(vc->vc == 0 || vc->vc == vc->preallocated) && new_capacity > VC_PREALLOCATED && vc->capacity <= VC_PREALLOCATED",   12980                               (Char const   *)"(vc->vc == 0 || vc->vc == vc->preallocated) && new_capacity > VC_PREALLOCATED && vc->capacity <= VC_PREALLOCATED",
12900                               (Char const   *)"drd_vc.c", 332,   12981                               (Char const   *)"drd_vc.c", 332,
12901                               (Char const   *)"vgDrd_vc_reserve", "");   12982                               (Char const   *)"vgDrd_vc_reserve", "");
12902         }   12983         }
12903         tmp___7 = vgPlain_malloc((HChar *)"drd.vc.vr.2",   12984         tmp___7 = vgPlain_malloc((HChar *)"drd.vc.vr.2",
12904                                  (SizeT )(new_capacity * (unsigned int const   )sizeof(*(vc->vc + 0))));   12985                                  (SizeT )(new_capacity * (unsigned int const   )sizeof(*(vc->vc + 0))));
12905         vc->vc = (VCElem *)tmp___7;   12986         vc->vc = (VCElem *)tmp___7;
12906         vgPlain_memcpy((void *)vc->vc, (void const   *)(vc->preallocated),   12987         vgPlain_memcpy((void *)vc->vc, (void const   *)(vc->preallocated),
12907                        (SizeT )(vc->capacity * sizeof(*(vc->vc + 0))));   12988                        (SizeT )(vc->capacity * sizeof(*(vc->vc + 0))));
12908       } else {   12989       } else {
12909         goto _L___0;   12990         goto _L___0;
12910       }   12991       }
12911     } else   12992     } else
12912     _L___0: /* CIL Label */   12993     _L___0: /* CIL Label */
12913     if (vc->vc) {   12994     if (vc->vc) {
12914       if ((unsigned int )vc->vc == (unsigned int )(vc->preallocated)) {   12995       if ((unsigned int )vc->vc == (unsigned int )(vc->preallocated)) {
12915         if (new_capacity <= 8U) {   12996         if (new_capacity <= 8U) {
12916           if (vc->capacity <= 8U) {   12997           if (vc->capacity <= 8U) {
12917             tmp___8 = 1;   12998             tmp___8 = 1;
12918           } else {   12999           } else {
12919             tmp___8 = 0;   13000             tmp___8 = 0;
12920           }   13001           }
12921         } else {   13002         } else {
12922           tmp___8 = 0;   13003           tmp___8 = 0;
12923         }   13004         }
12924       } else {   13005       } else {
12925         tmp___8 = 0;   13006         tmp___8 = 0;
12926       }   13007       }
12927       tmp___9 = __builtin_expect((long )tmp___8, 1L);   13008       tmp___9 = __builtin_expect((long )tmp___8, 1L);
12928       if (tmp___9) {   13009       if (tmp___9) {
12929     13010  
12930       } else {   13011       } else {
12931         vgPlain_assert_fail((Bool )0,   13012         vgPlain_assert_fail((Bool )0,
12932                             (Char const   *)"vc->vc == vc->preallocated && new_capacity <= VC_PREALLOCATED && vc->capacity <= VC_PREALLOCATED",   13013                             (Char const   *)"vc->vc == vc->preallocated && new_capacity <= VC_PREALLOCATED && vc->capacity <= VC_PREALLOCATED",
12933                             (Char const   *)"drd_vc.c", 342,   13014                             (Char const   *)"drd_vc.c", 342,
12934                             (Char const   *)"vgDrd_vc_reserve", "");   13015                             (Char const   *)"vgDrd_vc_reserve", "");
12935       }   13016       }
12936     } else   13017     } else
12937     if (new_capacity > 8U) {   13018     if (new_capacity > 8U) {
12938       if ((unsigned int )vc->vc == (unsigned int )((VCElem *)0)) {   13019       if ((unsigned int )vc->vc == (unsigned int )((VCElem *)0)) {
12939         if (new_capacity > 8U) {   13020         if (new_capacity > 8U) {
12940           if (vc->capacity == 0U) {   13021           if (vc->capacity == 0U) {
12941             tmp___10 = 1;   13022             tmp___10 = 1;
12942           } else {   13023           } else {
12943             tmp___10 = 0;   13024             tmp___10 = 0;
12944           }   13025           }
12945         } else {   13026         } else {
12946           tmp___10 = 0;   13027           tmp___10 = 0;
12947         }   13028         }
12948       } else {   13029       } else {
12949         tmp___10 = 0;   13030         tmp___10 = 0;
12950       }   13031       }
12951       tmp___11 = __builtin_expect((long )tmp___10, 1L);   13032       tmp___11 = __builtin_expect((long )tmp___10, 1L);
12952       if (tmp___11) {   13033       if (tmp___11) {
12953     13034  
12954       } else {   13035       } else {
12955         vgPlain_assert_fail((Bool )0,   13036         vgPlain_assert_fail((Bool )0,
12956                             (Char const   *)"vc->vc == 0 && new_capacity > VC_PREALLOCATED && vc->capacity == 0",   13037                             (Char const   *)"vc->vc == 0 && new_capacity > VC_PREALLOCATED && vc->capacity == 0",
12957                             (Char const   *)"drd_vc.c", 348,   13038                             (Char const   *)"drd_vc.c", 348,
12958                             (Char const   *)"vgDrd_vc_reserve", "");   13039                             (Char const   *)"vgDrd_vc_reserve", "");
12959       }   13040       }
12960       tmp___12 = vgPlain_malloc((HChar *)"drd.vc.vr.3",   13041       tmp___12 = vgPlain_malloc((HChar *)"drd.vc.vr.3",
12961                                 (SizeT )(new_capacity * (unsigned int const   )sizeof(*(vc->vc + 0))));   13042                                 (SizeT )(new_capacity * (unsigned int const   )sizeof(*(vc->vc + 0))));
12962       vc->vc = (VCElem *)tmp___12;   13043       vc->vc = (VCElem *)tmp___12;
12963     } else {   13044     } else {
12964       if ((unsigned int )vc->vc == (unsigned int )((VCElem *)0)) {   13045       if ((unsigned int )vc->vc == (unsigned int )((VCElem *)0)) {
12965         if (new_capacity <= 8U) {   13046         if (new_capacity <= 8U) {
12966           if (vc->capacity == 0U) {   13047           if (vc->capacity == 0U) {
12967             tmp___13 = 1;   13048             tmp___13 = 1;
12968           } else {   13049           } else {
12969             tmp___13 = 0;   13050             tmp___13 = 0;
12970           }   13051           }
12971         } else {   13052         } else {
12972           tmp___13 = 0;   13053           tmp___13 = 0;
12973         }   13054         }
12974       } else {   13055       } else {
12975         tmp___13 = 0;   13056         tmp___13 = 0;
12976       }   13057       }
12977       tmp___14 = __builtin_expect((long )tmp___13, 1L);   13058       tmp___14 = __builtin_expect((long )tmp___13, 1L);
12978       if (tmp___14) {   13059       if (tmp___14) {
12979     13060  
12980       } else {   13061       } else {
12981         vgPlain_assert_fail((Bool )0,   13062         vgPlain_assert_fail((Bool )0,
12982                             (Char const   *)"vc->vc == 0 && new_capacity <= VC_PREALLOCATED && vc->capacity == 0",   13063                             (Char const   *)"vc->vc == 0 && new_capacity <= VC_PREALLOCATED && vc->capacity == 0",
12983                             (Char const   *)"drd_vc.c", 356,   13064                             (Char const   *)"drd_vc.c", 356,
12984                             (Char const   *)"vgDrd_vc_reserve", "");   13065                             (Char const   *)"vgDrd_vc_reserve", "");
12985       }   13066       }
12986       vc->vc = vc->preallocated;   13067       vc->vc = vc->preallocated;
12987     }   13068     }
12988     vc->capacity = (unsigned int )new_capacity;   13069     vc->capacity = (unsigned int )new_capacity;
12989   } else   13070   } else
12990   if (new_capacity == 0U) {   13071   if (new_capacity == 0U) {
12991     if (vc->vc) {   13072     if (vc->vc) {
12992       if (vc->capacity > 8U) {   13073       if (vc->capacity > 8U) {
12993         vgPlain_free((void *)vc->vc);   13074         vgPlain_free((void *)vc->vc);
12994       } else {   13075       } else {
12995     13076  
12996       }   13077       }
12997       vc->vc = (VCElem *)0;   13078       vc->vc = (VCElem *)0;
12998       vc->capacity = 0U;   13079       vc->capacity = 0U;
12999     } else {   13080     } else {
13000     13081  
13001     }   13082     }
13002   } else {   13083   } else {
13003     13084  
13004   }   13085   }
13005   if (new_capacity == 0U) {   13086   if (new_capacity == 0U) {
13006     tmp___15 = 1;   13087     tmp___15 = 1;
13007   } else   13088   } else
13008   if ((unsigned int )vc->vc != (unsigned int )((VCElem *)0)) {   13089   if ((unsigned int )vc->vc != (unsigned int )((VCElem *)0)) {
13009     tmp___15 = 1;   13090     tmp___15 = 1;
13010   } else {   13091   } else {
13011     tmp___15 = 0;   13092     tmp___15 = 0;
13012   }   13093   }
13013   tmp___16 = __builtin_expect((long )tmp___15, 1L);   13094   tmp___16 = __builtin_expect((long )tmp___15, 1L);
13014   if (tmp___16) {   13095   if (tmp___16) {
13015     13096  
13016   } else {   13097   } else {
13017     vgPlain_assert_fail((Bool )0,   13098     vgPlain_assert_fail((Bool )0,
13018                         (Char const   *)"new_capacity == 0 || vc->vc != 0",   13099                         (Char const   *)"new_capacity == 0 || vc->vc != 0",
13019                         (Char const   *)"drd_vc.c", 369,   13100                         (Char const   *)"drd_vc.c", 369,
13020                         (Char const   *)"vgDrd_vc_reserve", "");   13101                         (Char const   *)"vgDrd_vc_reserve", "");
13021   }   13102   }
13022   if (vc->capacity > 8U) {   13103   if (vc->capacity > 8U) {
13023     tmp___17 = 1;   13104     tmp___17 = 1;
13024   } else   13105   } else
13025   if ((unsigned int )vc->vc == (unsigned int )((VCElem *)0)) {   13106   if ((unsigned int )vc->vc == (unsigned int )((VCElem *)0)) {
13026     tmp___17 = 1;   13107     tmp___17 = 1;
13027   } else   13108   } else
13028   if ((unsigned int )vc->vc == (unsigned int )(vc->preallocated)) {   13109   if ((unsigned int )vc->vc == (unsigned int )(vc->preallocated)) {
13029     tmp___17 = 1;   13110     tmp___17 = 1;
13030   } else {   13111   } else {
13031     tmp___17 = 0;   13112     tmp___17 = 0;
13032   }   13113   }
13033   tmp___18 = __builtin_expect((long )tmp___17, 1L);   13114   tmp___18 = __builtin_expect((long )tmp___17, 1L);
13034   if (tmp___18) {   13115   if (tmp___18) {
13035     13116  
13036   } else {   13117   } else {
13037     vgPlain_assert_fail((Bool )0,   13118     vgPlain_assert_fail((Bool )0,
13038                         (Char const   *)"vc->capacity > VC_PREALLOCATED || vc->vc == 0 || vc->vc == vc->preallocated",   13119                         (Char const   *)"vc->capacity > VC_PREALLOCATED || vc->vc == 0 || vc->vc == vc->preallocated",
13039                         (Char const   *)"drd_vc.c", 372,   13120                         (Char const   *)"drd_vc.c", 372,
13040                         (Char const   *)"vgDrd_vc_reserve", "");   13121                         (Char const   *)"vgDrd_vc_reserve", "");
13041   }   13122   }
13042   return;   13123   return;
13043 }   13124 }
13044 }   13125 }
13045 static Bool s_check_stack_accesses  =    (Bool )0;   13126 static Bool s_check_stack_accesses  =    (Bool )0;
13046 static Bool s_first_race_only  =    (Bool )0;   13127 static Bool s_first_race_only  =    (Bool )0;
13047 Bool vgDrd_get_check_stack_accesses(void)   13128 Bool vgDrd_get_check_stack_accesses(void)
13048 {   13129 {
13049     13130  
13050     13131  
13051   {   13132   {
13052   return (s_check_stack_accesses);   13133   return (s_check_stack_accesses);
13053 }   13134 }
13054 }   13135 }
13055 void vgDrd_set_check_stack_accesses(Bool const   c )   13136 void vgDrd_set_check_stack_accesses(Bool const   c )
13056 {   13137 {
13057   int tmp ;   13138   int tmp ;
13058   long tmp___0 ;   13139   long tmp___0 ;
13059     13140  
13060   {   13141   {
13061   if ((int const   )c == 0) {   13142   if ((int const   )c == 0) {
13062     tmp = 1;   13143     tmp = 1;
13063   } else   13144   } else
13064   if ((int const   )c == 1) {   13145   if ((int const   )c == 1) {
13065     tmp = 1;   13146     tmp = 1;
13066   } else {   13147   } else {
13067     tmp = 0;   13148     tmp = 0;
13068   }   13149   }
13069   tmp___0 = __builtin_expect((long )tmp, 1L);   13150   tmp___0 = __builtin_expect((long )tmp, 1L);
13070   if (tmp___0) {   13151   if (tmp___0) {
13071     13152  
13072   } else {   13153   } else {
13073     vgPlain_assert_fail((Bool )0, (Char const   *)"c == False || c == True",   13154     vgPlain_assert_fail((Bool )0, (Char const   *)"c == False || c == True",
13074                         (Char const   *)"drd_load_store.c", 72,   13155                         (Char const   *)"drd_load_store.c", 72,
13075                         (Char const   *)"vgDrd_set_check_stack_accesses", "");   13156                         (Char const   *)"vgDrd_set_check_stack_accesses", "");
13076   }   13157   }
13077   s_check_stack_accesses = (Bool )c;   13158   s_check_stack_accesses = (Bool )c;
13078   return;   13159   return;
13079 }   13160 }
13080 }   13161 }
13081 Bool vgDrd_get_first_race_only(void)   13162 Bool vgDrd_get_first_race_only(void)
13082 {   13163 {
13083     13164  
13084     13165  
13085   {   13166   {
13086   return (s_first_race_only);   13167   return (s_first_race_only);
13087 }   13168 }
13088 }   13169 }
13089 void vgDrd_set_first_race_only(Bool const   fro )   13170 void vgDrd_set_first_race_only(Bool const   fro )
13090 {   13171 {
13091   int tmp ;   13172   int tmp ;
13092   long tmp___0 ;   13173   long tmp___0 ;
13093     13174  
13094   {   13175   {
13095   if ((int const   )fro == 0) {   13176   if ((int const   )fro == 0) {
13096     tmp = 1;   13177     tmp = 1;
13097   } else   13178   } else
13098   if ((int const   )fro == 1) {   13179   if ((int const   )fro == 1) {
13099     tmp = 1;   13180     tmp = 1;
13100   } else {   13181   } else {
13101     tmp = 0;   13182     tmp = 0;
13102   }   13183   }
13103   tmp___0 = __builtin_expect((long )tmp, 1L);   13184   tmp___0 = __builtin_expect((long )tmp, 1L);
13104   if (tmp___0) {   13185   if (tmp___0) {
13105     13186  
13106   } else {   13187   } else {
13107     vgPlain_assert_fail((Bool )0, (Char const   *)"fro == False || fro == True",   13188     vgPlain_assert_fail((Bool )0, (Char const   *)"fro == False || fro == True",
13108                         (Char const   *)"drd_load_store.c", 83,   13189                         (Char const   *)"drd_load_store.c", 83,
13109                         (Char const   *)"vgDrd_set_first_race_only", "");   13190                         (Char const   *)"vgDrd_set_first_race_only", "");
13110   }   13191   }
13111   s_first_race_only = (Bool )fro;   13192   s_first_race_only = (Bool )fro;
13112   return;   13193   return;
13113 }   13194 }
13114 }   13195 }
13115 void vgDrd_trace_mem_access(Addr const   addr , SizeT const   size ,   13196 void vgDrd_trace_mem_access(Addr const   addr , SizeT const   size ,
13116                             BmAccessTypeT const   access_type ,   13197                             BmAccessTypeT const   access_type ,
13117                             HWord const   stored_value_hi ,   13198                             HWord const   stored_value_hi ,
13118                             HWord const   stored_value_lo )   13199                             HWord const   stored_value_lo )
13119 {   13200 {
13120   char *vc ;   13201   char *vc ;
13121   DrdThreadId tmp ;   13202   DrdThreadId tmp ;
13122   VectorClock *tmp___0 ;   13203   VectorClock *tmp___0 ;
13123   DrdThreadId tmp___1 ;   13204   DrdThreadId tmp___1 ;
13124   ULong sv ;   13205   ULong sv ;
13125   long tmp___2 ;   13206   long tmp___2 ;
13126   DrdThreadId tmp___3 ;   13207   DrdThreadId tmp___3 ;
13127   DrdThreadId tmp___4 ;   13208   DrdThreadId tmp___4 ;
13128   char const   *tmp___5 ;   13209   char const   *tmp___5 ;
13129   char const   *tmp___6 ;   13210   char const   *tmp___6 ;
13130   char const   *tmp___7 ;   13211   char const   *tmp___7 ;
13131   char const   *tmp___8 ;   13212   char const   *tmp___8 ;
13132   DrdThreadId tmp___9 ;   13213   DrdThreadId tmp___9 ;
13133   ThreadId tmp___10 ;   13214   ThreadId tmp___10 ;
13134   ThreadId tmp___11 ;   13215   ThreadId tmp___11 ;
13135   int tmp___12 ;   13216   int tmp___12 ;
13136   long tmp___13 ;   13217   long tmp___13 ;
13137   Bool tmp___14 ;   13218   Bool tmp___14 ;
13138     13219  
13139   {   13220   {
13140   tmp___14 = vgDrd_is_any_traced(addr, addr + size);   13221   tmp___14 = vgDrd_is_any_traced(addr, addr + size);
13141   if (tmp___14) {   13222   if (tmp___14) {
13142     tmp = vgDrd_thread_get_running_tid();   13223     tmp = vgDrd_thread_get_running_tid();
13143     tmp___0 = vgDrd_thread_get_vc((DrdThreadId const   )tmp);   13224     tmp___0 = vgDrd_thread_get_vc((DrdThreadId const   )tmp);
13144     vc = vgDrd_vc_aprint((VectorClock const   */* const  */)tmp___0);   13225     vc = vgDrd_vc_aprint((VectorClock const   */* const  */)tmp___0);
13145     if ((unsigned int const   )access_type == 1U) {   13226     if ((unsigned int const   )access_type == 1U) {
13146       if (size <= (SizeT const   )sizeof(HWord )) {   13227       if (size <= (SizeT const   )sizeof(HWord )) {
13147         tmp___1 = vgDrd_thread_get_running_tid();   13228         tmp___1 = vgDrd_thread_get_running_tid();
13148         vgDrd_trace_msg_w_bt("store 0x%lx size %ld val %ld/0x%lx (thread %d / vc %s)",   13229         vgDrd_trace_msg_w_bt("store 0x%lx size %ld val %ld/0x%lx (thread %d / vc %s)",
13149                              addr, size, stored_value_lo, stored_value_lo,   13230                              addr, size, stored_value_lo, stored_value_lo,
13150                              tmp___1, vc);   13231                              tmp___1, vc);
13151       } else {   13232       } else {
13152         goto _L___0;   13233         goto _L___0;
13153       }   13234       }
13154     } else   13235     } else
13155     _L___0: /* CIL Label */   13236     _L___0: /* CIL Label */
13156     if ((unsigned int const   )access_type == 1U) {   13237     if ((unsigned int const   )access_type == 1U) {
13157       if (size > (SizeT const   )sizeof(HWord )) {   13238       if (size > (SizeT const   )sizeof(HWord )) {
13158         tmp___2 = __builtin_expect((long )(! (! (sizeof(HWord ) == 4U))), 1L);   13239         tmp___2 = __builtin_expect((long )(! (! (sizeof(HWord ) == 4U))), 1L);
13159         if (tmp___2) {   13240         if (tmp___2) {
13160     13241  
13161         } else {   13242         } else {
13162           vgPlain_assert_fail((Bool )0, (Char const   *)"sizeof(HWord) == 4",   13243           vgPlain_assert_fail((Bool )0, (Char const   *)"sizeof(HWord) == 4",
13163                               (Char const   *)"drd_load_store.c", 105,   13244                               (Char const   *)"drd_load_store.c", 105,
13164                               (Char const   *)"vgDrd_trace_mem_access", "");   13245                               (Char const   *)"vgDrd_trace_mem_access", "");
13165         }   13246         }
13166         sv = ((ULong )stored_value_hi << 32) | (unsigned long long )stored_value_lo;   13247         sv = ((ULong )stored_value_hi << 32) | (unsigned long long )stored_value_lo;
13167         tmp___3 = vgDrd_thread_get_running_tid();   13248         tmp___3 = vgDrd_thread_get_running_tid();
13168         vgDrd_trace_msg_w_bt("store 0x%lx size %ld val %lld/0x%llx (thread %d / vc %s)",   13249         vgDrd_trace_msg_w_bt("store 0x%lx size %ld val %lld/0x%llx (thread %d / vc %s)",
13169                              addr, size, sv, sv, tmp___3, vc);   13250                              addr, size, sv, sv, tmp___3, vc);
13170       } else {   13251       } else {
13171         goto _L;   13252         goto _L;
13172       }   13253       }
13173     } else {   13254     } else {
13174       _L: /* CIL Label */   13255       _L: /* CIL Label */
13175       tmp___4 = vgDrd_thread_get_running_tid();   13256       tmp___4 = vgDrd_thread_get_running_tid();
13176       if ((unsigned int const   )access_type == 0U) {   13257       if ((unsigned int const   )access_type == 0U) {
13177         tmp___8 = "load ";   13258         tmp___8 = "load ";
13178       } else {   13259       } else {
13179         if ((unsigned int const   )access_type == 1U) {   13260         if ((unsigned int const   )access_type == 1U) {
13180           tmp___7 = "store";   13261           tmp___7 = "store";
13181         } else {   13262         } else {
13182           if ((unsigned int const   )access_type == 2U) {   13263           if ((unsigned int const   )access_type == 2U) {
13183             tmp___6 = "start";   13264             tmp___6 = "start";
13184           } else {   13265           } else {
13185             if ((unsigned int const   )access_type == 3U) {   13266             if ((unsigned int const   )access_type == 3U) {
13186               tmp___5 = "end  ";   13267               tmp___5 = "end  ";
13187             } else {   13268             } else {
13188               tmp___5 = "????";   13269               tmp___5 = "????";
13189             }   13270             }
13190             tmp___6 = tmp___5;   13271             tmp___6 = tmp___5;
13191           }   13272           }
13192           tmp___7 = tmp___6;   13273           tmp___7 = tmp___6;
13193         }   13274         }
13194         tmp___8 = tmp___7;   13275         tmp___8 = tmp___7;
13195       }   13276       }
13196       vgDrd_trace_msg_w_bt("%s 0x%lx size %ld (thread %d / vc %s)", tmp___8,   13277       vgDrd_trace_msg_w_bt("%s 0x%lx size %ld (thread %d / vc %s)", tmp___8,
13197                            addr, size, tmp___4, vc);   13278                            addr, size, tmp___4, vc);
13198     }   13279     }
13199     vgPlain_free((void *)vc);   13280     vgPlain_free((void *)vc);
13200     tmp___9 = vgDrd_thread_get_running_tid();   13281     tmp___9 = vgDrd_thread_get_running_tid();
13201     tmp___10 = vgDrd_DrdThreadIdToVgThreadId((DrdThreadId const   )tmp___9);   13282     tmp___10 = vgDrd_DrdThreadIdToVgThreadId((DrdThreadId const   )tmp___9);
13202     tmp___11 = vgPlain_get_running_tid();   13283     tmp___11 = vgPlain_get_running_tid();
13203     if (tmp___10 == tmp___11) {   13284     if (tmp___10 == tmp___11) {
13204       tmp___12 = 1;   13285       tmp___12 = 1;
13205     } else {   13286     } else {
13206       tmp___12 = 0;   13287       tmp___12 = 0;
13207     }   13288     }
13208     tmp___13 = __builtin_expect((long )tmp___12, 1L);   13289     tmp___13 = __builtin_expect((long )tmp___12, 1L);
13209     if (tmp___13) {   13290     if (tmp___13) {
13210     13291  
13211     } else {   13292     } else {
13212       vgPlain_assert_fail((Bool )0,   13293       vgPlain_assert_fail((Bool )0,
13213                           (Char const   *)"DRD_(DrdThreadIdToVgThreadId)(DRD_(thread_get_running_tid)()) == VG_(get_running_tid)()",   13294                           (Char const   *)"DRD_(DrdThreadIdToVgThreadId)(DRD_(thread_get_running_tid)()) == VG_(get_running_tid)()",
13214                           (Char const   *)"drd_load_store.c", 120,   13295                           (Char const   *)"drd_load_store.c", 120,
13215                           (Char const   *)"vgDrd_trace_mem_access", "");   13296                           (Char const   *)"vgDrd_trace_mem_access", "");
13216     }   13297     }
13217   } else {   13298   } else {
13218     13299  
13219   }   13300   }
13220   return;   13301   return;
13221 }   13302 }
13222 }   13303 }
13223 static void ( __attribute__((__regparm__(2))) drd_trace_mem_load)(Addr const   addr ,   13304 static void ( __attribute__((__regparm__(2))) drd_trace_mem_load)(Addr const   addr ,
13224                                                                   SizeT const   size )   13305                                                                   SizeT const   size )
13225 {   13306 {
13226     13307  
13227     13308  
13228   {   13309   {
13229   vgDrd_trace_mem_access(addr, size, (BmAccessTypeT const   )0,   13310   vgDrd_trace_mem_access(addr, size, (BmAccessTypeT const   )0,
13230                          (HWord const   )0, (HWord const   )0);   13311                          (HWord const   )0, (HWord const   )0);
13231   return;   13312   return;
13232 }   13313 }
13233 }   13314 }
13234 static void ( __attribute__((__regparm__(3))) drd_trace_mem_store)(Addr const   addr ,   13315 static void ( __attribute__((__regparm__(3))) drd_trace_mem_store)(Addr const   addr ,
13235                                                                    SizeT const   size ,   13316                                                                    SizeT const   size ,
13236                                                                    HWord const   stored_value_hi ,   13317                                                                    HWord const   stored_value_hi ,
13237                                                                    HWord const   stored_value_lo )   13318                                                                    HWord const   stored_value_lo )
13238 {   13319 {
13239     13320  
13240     13321  
13241   {   13322   {
13242   vgDrd_trace_mem_access(addr, size, (BmAccessTypeT const   )1, stored_value_hi,   13323   vgDrd_trace_mem_access(addr, size, (BmAccessTypeT const   )1, stored_value_hi,
13243                          stored_value_lo);   13324                          stored_value_lo);
13244   return;   13325   return;
13245 }   13326 }
13246 }   13327 }
13247 static void drd_report_race(Addr const   addr , SizeT const   size ,   13328 static void drd_report_race(Addr const   addr , SizeT const   size ,
13248                             BmAccessTypeT const   access_type )   13329                             BmAccessTypeT const   access_type )
13249 {   13330 {
13250   ThreadId vg_tid ;   13331   ThreadId vg_tid ;
13251   DataRaceErrInfo drei ;   13332   DataRaceErrInfo drei ;
13252   DrdThreadId tmp ;   13333   DrdThreadId tmp ;
13253   Addr tmp___0 ;   13334   Addr tmp___0 ;
13254   Bool tmp___1 ;   13335   Bool tmp___1 ;
13255     13336  
13256   {   13337   {
13257   vg_tid = vgPlain_get_running_tid();   13338   vg_tid = vgPlain_get_running_tid();
13258   tmp___1 = vgDrd_thread_address_on_any_stack(addr);   13339   tmp___1 = vgDrd_thread_address_on_any_stack(addr);
13259   if (tmp___1) {   13340   if (tmp___1) {
13260     13341  
13261   } else {   13342   } else {
13262     tmp = vgDrd_thread_get_running_tid();   13343     tmp = vgDrd_thread_get_running_tid();
13263     drei.tid = tmp;   13344     drei.tid = tmp;
13264     drei.addr = (Addr )addr;   13345     drei.addr = (Addr )addr;
13265     drei.size = (SizeT )size;   13346     drei.size = (SizeT )size;
13266     drei.access_type = (BmAccessTypeT )access_type;   13347     drei.access_type = (BmAccessTypeT )access_type;
13267     tmp___0 = vgPlain_get_IP(vg_tid);   13348     tmp___0 = vgPlain_get_IP(vg_tid);
13268     vgPlain_maybe_record_error(vg_tid, 1, tmp___0, (Char *)"Conflicting access",   13349     vgPlain_maybe_record_error(vg_tid, 1, tmp___0, (Char *)"Conflicting access",
13269                                (void *)(& drei));   13350                                (void *)(& drei));
13270     if (s_first_race_only) {   13351     if (s_first_race_only) {
13271       vgDrd_start_suppression(addr, addr + size,   13352       vgDrd_start_suppression(addr, addr + size,
13272                               (char const   */* const  */)"first race only");   13353                               (char const   */* const  */)"first race only");
13273     } else {   13354     } else {
13274     13355  
13275     }   13356     }
13276   }   13357   }
13277   return;   13358   return;
13278 }   13359 }
13279 }   13360 }
13280 void ( __attribute__((__regparm__(2))) vgDrd_trace_load)(Addr addr , SizeT size )   13361 void ( __attribute__((__regparm__(2))) vgDrd_trace_load)(Addr addr , SizeT size )
13281 {   13362 {
13282   Bool tmp ;   13363   Bool tmp ;
13283   Bool tmp___0 ;   13364   Bool tmp___0 ;
13284   Bool tmp___1 ;   13365   Bool tmp___1 ;
13285   Bool tmp___2 ;   13366   Bool tmp___2 ;
13286     13367  
13287   {   13368   {
13288   tmp = vgDrd_running_thread_is_recording_loads();   13369   tmp = vgDrd_running_thread_is_recording_loads();
13289   if (tmp) {   13370   if (tmp) {
13290     if (s_check_stack_accesses) {   13371     if (s_check_stack_accesses) {
13291       goto _L;   13372       goto _L;
13292     } else {   13373     } else {
13293       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);   13374       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);
13294       if (tmp___0) {   13375       if (tmp___0) {
13295     13376  
13296       } else {   13377       } else {
13297         _L: /* CIL Label */   13378         _L: /* CIL Label */
13298         tmp___1 = bm_access_load_triggers_conflict((Addr const   )addr,   13379         tmp___1 = bm_access_load_triggers_conflict((Addr const   )addr,
13299                                                    (Addr const   )(addr + size));   13380                                                    (Addr const   )(addr + size));
13300         if (tmp___1) {   13381         if (tmp___1) {
13301           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,   13382           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,
13302                                         (Addr const   )(addr + size));   13383                                         (Addr const   )(addr + size));
13303           if (tmp___2) {   13384           if (tmp___2) {
13304     13385  
13305           } else {   13386           } else {
13306             drd_report_race((Addr const   )addr, (SizeT const   )size,   13387             drd_report_race((Addr const   )addr, (SizeT const   )size,
13307                             (BmAccessTypeT const   )0);   13388                             (BmAccessTypeT const   )0);
13308           }   13389           }
13309         } else {   13390         } else {
13310     13391  
13311         }   13392         }
13312       }   13393       }
13313     }   13394     }
13314   } else {   13395   } else {
13315     13396  
13316   }   13397   }
13317   return;   13398   return;
13318 }   13399 }
13319 }   13400 }
13320 static void ( __attribute__((__regparm__(1))) drd_trace_load_1)(Addr addr )   13401 static void ( __attribute__((__regparm__(1))) drd_trace_load_1)(Addr addr )
13321 {   13402 {
13322   Bool tmp ;   13403   Bool tmp ;
13323   Bool tmp___0 ;   13404   Bool tmp___0 ;
13324   Bool tmp___1 ;   13405   Bool tmp___1 ;
13325   Bool tmp___2 ;   13406   Bool tmp___2 ;
13326     13407  
13327   {   13408   {
13328   tmp = vgDrd_running_thread_is_recording_loads();   13409   tmp = vgDrd_running_thread_is_recording_loads();
13329   if (tmp) {   13410   if (tmp) {
13330     if (s_check_stack_accesses) {   13411     if (s_check_stack_accesses) {
13331       goto _L;   13412       goto _L;
13332     } else {   13413     } else {
13333       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);   13414       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);
13334       if (tmp___0) {   13415       if (tmp___0) {
13335     13416  
13336       } else {   13417       } else {
13337         _L: /* CIL Label */   13418         _L: /* CIL Label */
13338         tmp___1 = bm_access_load_1_triggers_conflict((Addr const   )addr);   13419         tmp___1 = bm_access_load_1_triggers_conflict((Addr const   )addr);
13339         if (tmp___1) {   13420         if (tmp___1) {
13340           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,   13421           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,
13341                                         (Addr const   )(addr + 1UL));   13422                                         (Addr const   )(addr + 1UL));
13342           if (tmp___2) {   13423           if (tmp___2) {
13343     13424  
13344           } else {   13425           } else {
13345             drd_report_race((Addr const   )addr, (SizeT const   )1,   13426             drd_report_race((Addr const   )addr, (SizeT const   )1,
13346                             (BmAccessTypeT const   )0);   13427                             (BmAccessTypeT const   )0);
13347           }   13428           }
13348         } else {   13429         } else {
13349     13430  
13350         }   13431         }
13351       }   13432       }
13352     }   13433     }
13353   } else {   13434   } else {
13354     13435  
13355   }   13436   }
13356   return;   13437   return;
13357 }   13438 }
13358 }   13439 }
13359 static void ( __attribute__((__regparm__(1))) drd_trace_load_2)(Addr addr )   13440 static void ( __attribute__((__regparm__(1))) drd_trace_load_2)(Addr addr )
13360 {   13441 {
13361   Bool tmp ;   13442   Bool tmp ;
13362   Bool tmp___0 ;   13443   Bool tmp___0 ;
13363   Bool tmp___1 ;   13444   Bool tmp___1 ;
13364   Bool tmp___2 ;   13445   Bool tmp___2 ;
13365     13446  
13366   {   13447   {
13367   tmp = vgDrd_running_thread_is_recording_loads();   13448   tmp = vgDrd_running_thread_is_recording_loads();
13368   if (tmp) {   13449   if (tmp) {
13369     if (s_check_stack_accesses) {   13450     if (s_check_stack_accesses) {
13370       goto _L;   13451       goto _L;
13371     } else {   13452     } else {
13372       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);   13453       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);
13373       if (tmp___0) {   13454       if (tmp___0) {
13374     13455  
13375       } else {   13456       } else {
13376         _L: /* CIL Label */   13457         _L: /* CIL Label */
13377         tmp___1 = bm_access_load_2_triggers_conflict((Addr const   )addr);   13458         tmp___1 = bm_access_load_2_triggers_conflict((Addr const   )addr);
13378         if (tmp___1) {   13459         if (tmp___1) {
13379           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,   13460           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,
13380                                         (Addr const   )(addr + 2UL));   13461                                         (Addr const   )(addr + 2UL));
13381           if (tmp___2) {   13462           if (tmp___2) {
13382     13463  
13383           } else {   13464           } else {
13384             drd_report_race((Addr const   )addr, (SizeT const   )2,   13465             drd_report_race((Addr const   )addr, (SizeT const   )2,
13385                             (BmAccessTypeT const   )0);   13466                             (BmAccessTypeT const   )0);
13386           }   13467           }
13387         } else {   13468         } else {
13388     13469  
13389         }   13470         }
13390       }   13471       }
13391     }   13472     }
13392   } else {   13473   } else {
13393     13474  
13394   }   13475   }
13395   return;   13476   return;
13396 }   13477 }
13397 }   13478 }
13398 static void ( __attribute__((__regparm__(1))) drd_trace_load_4)(Addr addr )   13479 static void ( __attribute__((__regparm__(1))) drd_trace_load_4)(Addr addr )
13399 {   13480 {
13400   Bool tmp ;   13481   Bool tmp ;
13401   Bool tmp___0 ;   13482   Bool tmp___0 ;
13402   Bool tmp___1 ;   13483   Bool tmp___1 ;
13403   Bool tmp___2 ;   13484   Bool tmp___2 ;
13404     13485  
13405   {   13486   {
13406   tmp = vgDrd_running_thread_is_recording_loads();   13487   tmp = vgDrd_running_thread_is_recording_loads();
13407   if (tmp) {   13488   if (tmp) {
13408     if (s_check_stack_accesses) {   13489     if (s_check_stack_accesses) {
13409       goto _L;   13490       goto _L;
13410     } else {   13491     } else {
13411       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);   13492       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);
13412       if (tmp___0) {   13493       if (tmp___0) {
13413     13494  
13414       } else {   13495       } else {
13415         _L: /* CIL Label */   13496         _L: /* CIL Label */
13416         tmp___1 = bm_access_load_4_triggers_conflict((Addr const   )addr);   13497         tmp___1 = bm_access_load_4_triggers_conflict((Addr const   )addr);
13417         if (tmp___1) {   13498         if (tmp___1) {
13418           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,   13499           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,
13419                                         (Addr const   )(addr + 4UL));   13500                                         (Addr const   )(addr + 4UL));
13420           if (tmp___2) {   13501           if (tmp___2) {
13421     13502  
13422           } else {   13503           } else {
13423             drd_report_race((Addr const   )addr, (SizeT const   )4,   13504             drd_report_race((Addr const   )addr, (SizeT const   )4,
13424                             (BmAccessTypeT const   )0);   13505                             (BmAccessTypeT const   )0);
13425           }   13506           }
13426         } else {   13507         } else {
13427     13508  
13428         }   13509         }
13429       }   13510       }
13430     }   13511     }
13431   } else {   13512   } else {
13432     13513  
13433   }   13514   }
13434   return;   13515   return;
13435 }   13516 }
13436 }   13517 }
13437 static void ( __attribute__((__regparm__(1))) drd_trace_load_8)(Addr addr )   13518 static void ( __attribute__((__regparm__(1))) drd_trace_load_8)(Addr addr )
13438 {   13519 {
13439   Bool tmp ;   13520   Bool tmp ;
13440   Bool tmp___0 ;   13521   Bool tmp___0 ;
13441   Bool tmp___1 ;   13522   Bool tmp___1 ;
13442   Bool tmp___2 ;   13523   Bool tmp___2 ;
13443     13524  
13444   {   13525   {
13445   tmp = vgDrd_running_thread_is_recording_loads();   13526   tmp = vgDrd_running_thread_is_recording_loads();
13446   if (tmp) {   13527   if (tmp) {
13447     if (s_check_stack_accesses) {   13528     if (s_check_stack_accesses) {
13448       goto _L;   13529       goto _L;
13449     } else {   13530     } else {
13450       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);   13531       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);
13451       if (tmp___0) {   13532       if (tmp___0) {
13452     13533  
13453       } else {   13534       } else {
13454         _L: /* CIL Label */   13535         _L: /* CIL Label */
13455         tmp___1 = bm_access_load_8_triggers_conflict((Addr const   )addr);   13536         tmp___1 = bm_access_load_8_triggers_conflict((Addr const   )addr);
13456         if (tmp___1) {   13537         if (tmp___1) {
13457           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,   13538           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,
13458                                         (Addr const   )(addr + 8UL));   13539                                         (Addr const   )(addr + 8UL));
13459           if (tmp___2) {   13540           if (tmp___2) {
13460     13541  
13461           } else {   13542           } else {
13462             drd_report_race((Addr const   )addr, (SizeT const   )8,   13543             drd_report_race((Addr const   )addr, (SizeT const   )8,
13463                             (BmAccessTypeT const   )0);   13544                             (BmAccessTypeT const   )0);
13464           }   13545           }
13465         } else {   13546         } else {
13466     13547  
13467         }   13548         }
13468       }   13549       }
13469     }   13550     }
13470   } else {   13551   } else {
13471     13552  
13472   }   13553   }
13473   return;   13554   return;
13474 }   13555 }
13475 }   13556 }
13476 void ( __attribute__((__regparm__(2))) vgDrd_trace_store)(Addr addr ,   13557 void ( __attribute__((__regparm__(2))) vgDrd_trace_store)(Addr addr ,
13477                                                           SizeT size )   13558                                                           SizeT size )
13478 {   13559 {
13479   Bool tmp ;   13560   Bool tmp ;
13480   Bool tmp___0 ;   13561   Bool tmp___0 ;
13481   Bool tmp___1 ;   13562   Bool tmp___1 ;
13482   Bool tmp___2 ;   13563   Bool tmp___2 ;
13483     13564  
13484   {   13565   {
13485   tmp = vgDrd_running_thread_is_recording_stores();   13566   tmp = vgDrd_running_thread_is_recording_stores();
13486   if (tmp) {   13567   if (tmp) {
13487     if (s_check_stack_accesses) {   13568     if (s_check_stack_accesses) {
13488       goto _L;   13569       goto _L;
13489     } else {   13570     } else {
13490       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);   13571       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);
13491       if (tmp___0) {   13572       if (tmp___0) {
13492     13573  
13493       } else {   13574       } else {
13494         _L: /* CIL Label */   13575         _L: /* CIL Label */
13495         tmp___1 = bm_access_store_triggers_conflict((Addr const   )addr,   13576         tmp___1 = bm_access_store_triggers_conflict((Addr const   )addr,
13496                                                     (Addr const   )(addr + size));   13577                                                     (Addr const   )(addr + size));
13497         if (tmp___1) {   13578         if (tmp___1) {
13498           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,   13579           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,
13499                                         (Addr const   )(addr + size));   13580                                         (Addr const   )(addr + size));
13500           if (tmp___2) {   13581           if (tmp___2) {
13501     13582  
13502           } else {   13583           } else {
13503             drd_report_race((Addr const   )addr, (SizeT const   )size,   13584             drd_report_race((Addr const   )addr, (SizeT const   )size,
13504                             (BmAccessTypeT const   )1);   13585                             (BmAccessTypeT const   )1);
13505           }   13586           }
13506         } else {   13587         } else {
13507     13588  
13508         }   13589         }
13509       }   13590       }
13510     }   13591     }
13511   } else {   13592   } else {
13512     13593  
13513   }   13594   }
13514   return;   13595   return;
13515 }   13596 }
13516 }   13597 }
13517 static void ( __attribute__((__regparm__(1))) drd_trace_store_1)(Addr addr )   13598 static void ( __attribute__((__regparm__(1))) drd_trace_store_1)(Addr addr )
13518 {   13599 {
13519   Bool tmp ;   13600   Bool tmp ;
13520   Bool tmp___0 ;   13601   Bool tmp___0 ;
13521   Bool tmp___1 ;   13602   Bool tmp___1 ;
13522   Bool tmp___2 ;   13603   Bool tmp___2 ;
13523     13604  
13524   {   13605   {
13525   tmp = vgDrd_running_thread_is_recording_stores();   13606   tmp = vgDrd_running_thread_is_recording_stores();
13526   if (tmp) {   13607   if (tmp) {
13527     if (s_check_stack_accesses) {   13608     if (s_check_stack_accesses) {
13528       goto _L;   13609       goto _L;
13529     } else {   13610     } else {
13530       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);   13611       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);
13531       if (tmp___0) {   13612       if (tmp___0) {
13532     13613  
13533       } else {   13614       } else {
13534         _L: /* CIL Label */   13615         _L: /* CIL Label */
13535         tmp___1 = bm_access_store_1_triggers_conflict((Addr const   )addr);   13616         tmp___1 = bm_access_store_1_triggers_conflict((Addr const   )addr);
13536         if (tmp___1) {   13617         if (tmp___1) {
13537           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,   13618           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,
13538                                         (Addr const   )(addr + 1UL));   13619                                         (Addr const   )(addr + 1UL));
13539           if (tmp___2) {   13620           if (tmp___2) {
13540     13621  
13541           } else {   13622           } else {
13542             drd_report_race((Addr const   )addr, (SizeT const   )1,   13623             drd_report_race((Addr const   )addr, (SizeT const   )1,
13543                             (BmAccessTypeT const   )1);   13624                             (BmAccessTypeT const   )1);
13544           }   13625           }
13545         } else {   13626         } else {
13546     13627  
13547         }   13628         }
13548       }   13629       }
13549     }   13630     }
13550   } else {   13631   } else {
13551     13632  
13552   }   13633   }
13553   return;   13634   return;
13554 }   13635 }
13555 }   13636 }
13556 static void ( __attribute__((__regparm__(1))) drd_trace_store_2)(Addr addr )   13637 static void ( __attribute__((__regparm__(1))) drd_trace_store_2)(Addr addr )
13557 {   13638 {
13558   Bool tmp ;   13639   Bool tmp ;
13559   Bool tmp___0 ;   13640   Bool tmp___0 ;
13560   Bool tmp___1 ;   13641   Bool tmp___1 ;
13561   Bool tmp___2 ;   13642   Bool tmp___2 ;
13562     13643  
13563   {   13644   {
13564   tmp = vgDrd_running_thread_is_recording_stores();   13645   tmp = vgDrd_running_thread_is_recording_stores();
13565   if (tmp) {   13646   if (tmp) {
13566     if (s_check_stack_accesses) {   13647     if (s_check_stack_accesses) {
13567       goto _L;   13648       goto _L;
13568     } else {   13649     } else {
13569       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);   13650       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);
13570       if (tmp___0) {   13651       if (tmp___0) {
13571     13652  
13572       } else {   13653       } else {
13573         _L: /* CIL Label */   13654         _L: /* CIL Label */
13574         tmp___1 = bm_access_store_2_triggers_conflict((Addr const   )addr);   13655         tmp___1 = bm_access_store_2_triggers_conflict((Addr const   )addr);
13575         if (tmp___1) {   13656         if (tmp___1) {
13576           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,   13657           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,
13577                                         (Addr const   )(addr + 2UL));   13658                                         (Addr const   )(addr + 2UL));
13578           if (tmp___2) {   13659           if (tmp___2) {
13579     13660  
13580           } else {   13661           } else {
13581             drd_report_race((Addr const   )addr, (SizeT const   )2,   13662             drd_report_race((Addr const   )addr, (SizeT const   )2,
13582                             (BmAccessTypeT const   )1);   13663                             (BmAccessTypeT const   )1);
13583           }   13664           }
13584         } else {   13665         } else {
13585     13666  
13586         }   13667         }
13587       }   13668       }
13588     }   13669     }
13589   } else {   13670   } else {
13590     13671  
13591   }   13672   }
13592   return;   13673   return;
13593 }   13674 }
13594 }   13675 }
13595 static void ( __attribute__((__regparm__(1))) drd_trace_store_4)(Addr addr )   13676 static void ( __attribute__((__regparm__(1))) drd_trace_store_4)(Addr addr )
13596 {   13677 {
13597   Bool tmp ;   13678   Bool tmp ;
13598   Bool tmp___0 ;   13679   Bool tmp___0 ;
13599   Bool tmp___1 ;   13680   Bool tmp___1 ;
13600   Bool tmp___2 ;   13681   Bool tmp___2 ;
13601     13682  
13602   {   13683   {
13603   tmp = vgDrd_running_thread_is_recording_stores();   13684   tmp = vgDrd_running_thread_is_recording_stores();
13604   if (tmp) {   13685   if (tmp) {
13605     if (s_check_stack_accesses) {   13686     if (s_check_stack_accesses) {
13606       goto _L;   13687       goto _L;
13607     } else {   13688     } else {
13608       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);   13689       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);
13609       if (tmp___0) {   13690       if (tmp___0) {
13610     13691  
13611       } else {   13692       } else {
13612         _L: /* CIL Label */   13693         _L: /* CIL Label */
13613         tmp___1 = bm_access_store_4_triggers_conflict((Addr const   )addr);   13694         tmp___1 = bm_access_store_4_triggers_conflict((Addr const   )addr);
13614         if (tmp___1) {   13695         if (tmp___1) {
13615           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,   13696           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,
13616                                         (Addr const   )(addr + 4UL));   13697                                         (Addr const   )(addr + 4UL));
13617           if (tmp___2) {   13698           if (tmp___2) {
13618     13699  
13619           } else {   13700           } else {
13620             drd_report_race((Addr const   )addr, (SizeT const   )4,   13701             drd_report_race((Addr const   )addr, (SizeT const   )4,
13621                             (BmAccessTypeT const   )1);   13702                             (BmAccessTypeT const   )1);
13622           }   13703           }
13623         } else {   13704         } else {
13624     13705  
13625         }   13706         }
13626       }   13707       }
13627     }   13708     }
13628   } else {   13709   } else {
13629     13710  
13630   }   13711   }
13631   return;   13712   return;
13632 }   13713 }
13633 }   13714 }
13634 static void ( __attribute__((__regparm__(1))) drd_trace_store_8)(Addr addr )   13715 static void ( __attribute__((__regparm__(1))) drd_trace_store_8)(Addr addr )
13635 {   13716 {
13636   Bool tmp ;   13717   Bool tmp ;
13637   Bool tmp___0 ;   13718   Bool tmp___0 ;
13638   Bool tmp___1 ;   13719   Bool tmp___1 ;
13639   Bool tmp___2 ;   13720   Bool tmp___2 ;
13640     13721  
13641   {   13722   {
13642   tmp = vgDrd_running_thread_is_recording_stores();   13723   tmp = vgDrd_running_thread_is_recording_stores();
13643   if (tmp) {   13724   if (tmp) {
13644     if (s_check_stack_accesses) {   13725     if (s_check_stack_accesses) {
13645       goto _L;   13726       goto _L;
13646     } else {   13727     } else {
13647       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);   13728       tmp___0 = vgDrd_thread_address_on_stack((Addr const   )addr);
13648       if (tmp___0) {   13729       if (tmp___0) {
13649     13730  
13650       } else {   13731       } else {
13651         _L: /* CIL Label */   13732         _L: /* CIL Label */
13652         tmp___1 = bm_access_store_8_triggers_conflict((Addr const   )addr);   13733         tmp___1 = bm_access_store_8_triggers_conflict((Addr const   )addr);
13653         if (tmp___1) {   13734         if (tmp___1) {
13654           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,   13735           tmp___2 = vgDrd_is_suppressed((Addr const   )addr,
13655                                         (Addr const   )(addr + 8UL));   13736                                         (Addr const   )(addr + 8UL));
13656           if (tmp___2) {   13737           if (tmp___2) {
13657     13738  
13658           } else {   13739           } else {
13659             drd_report_race((Addr const   )addr, (SizeT const   )8,   13740             drd_report_race((Addr const   )addr, (SizeT const   )8,
13660                             (BmAccessTypeT const   )1);   13741                             (BmAccessTypeT const   )1);
13661           }   13742           }
13662         } else {   13743         } else {
13663     13744  
13664         }   13745         }
13665       }   13746       }
13666     }   13747     }
13667   } else {   13748   } else {
13668     13749  
13669   }   13750   }
13670   return;   13751   return;
13671 }   13752 }
13672 }   13753 }
13673 static Bool is_stack_access(IRSB * const  bb , IRExpr * const  addr_expr )   13754 static Bool is_stack_access(IRSB * const  bb , IRExpr * const  addr_expr )
13674 {   13755 {
13675   Bool result ;   13756   Bool result ;
13676   int i ;   13757   int i ;
13677   IRExpr *e ;   13758   IRExpr *e ;
13678     13759  
13679   {   13760   {
13680   result = (Bool )0;   13761   result = (Bool )0;
13681   if ((unsigned int )addr_expr->tag == 86019U) {   13762   if ((unsigned int )addr_expr->tag == 86019U) {
13682     i = 0;   13763     i = 0;
13683     while (i < bb->stmts_size) {   13764     while (i < bb->stmts_size) {
13684       if (*(bb->stmts + i)) {   13765       if (*(bb->stmts + i)) {
13685         if ((unsigned int )(*(bb->stmts + i))->tag == 102405U) {   13766         if ((unsigned int )(*(bb->stmts + i))->tag == 102405U) {
13686           if ((*(bb->stmts + i))->Ist.WrTmp.tmp == addr_expr->Iex.RdTmp.tmp) {   13767           if ((*(bb->stmts + i))->Ist.WrTmp.tmp == addr_expr->Iex.RdTmp.tmp) {
13687             e = (*(bb->stmts + i))->Ist.WrTmp.data;   13768             e = (*(bb->stmts + i))->Ist.WrTmp.data;
13688             if ((unsigned int )e->tag == 86017U) {   13769             if ((unsigned int )e->tag == 86017U) {
13689               if (e->Iex.Get.offset == 16) {   13770               if (e->Iex.Get.offset == 16) {
13690                 result = (Bool )1;   13771                 result = (Bool )1;
13691               } else {   13772               } else {
13692     13773  
13693               }   13774               }
13694             } else {   13775             } else {
13695     13776  
13696             }   13777             }
13697             break;   13778             break;
13698           } else {   13779           } else {
13699     13780  
13700           }   13781           }
13701         } else {   13782         } else {
13702     13783  
13703         }   13784         }
13704       } else {   13785       } else {
13705     13786  
13706       }   13787       }
13707       i ++;   13788       i ++;
13708     }   13789     }
13709   } else {   13790   } else {
13710     13791  
13711   }   13792   }
13712   return (result);   13793   return (result);
13713 }   13794 }
13714 }   13795 }
13715 static IROp const   u_widen_irop[5][9]  = { {        0,        0,        0,        0,   13796 static IROp const   u_widen_irop[5][9]  = { {        0,        0,        0,        0,
13716             (IROp const   )82056,        0,        0,        0,   13797             (IROp const   )82056,        0,        0,        0,
13717             (IROp const   )82057},   13798             (IROp const   )82057},
13718    {        0,        0,        0,        0,   13799    {        0,        0,        0,        0,
13719             (IROp const   )82026,        0,        0,        0,   13800             (IROp const   )82026,        0,        0,        0,
13720             (IROp const   )82027},   13801             (IROp const   )82027},
13721    {        0,        0,        0,        0,   13802    {        0,        0,        0,        0,
13722             (IROp const   )82028,        0,        0,        0,   13803             (IROp const   )82028,        0,        0,        0,
13723             (IROp const   )82029},   13804             (IROp const   )82029},
13724    {        0,        0,        0,        0,   13805    {        0,        0,        0,        0,
13725             0,        0,        0,        0,   13806             0,        0,        0,        0,
13726             (IROp const   )82030}};   13807             (IROp const   )82030}};
13727 static IRExpr *instr_trace_mem_load(IRSB * const  bb , IRExpr *addr_expr ,   13808 static IRExpr *instr_trace_mem_load(IRSB * const  bb , IRExpr *addr_expr ,
13728                                     HWord const   size )   13809                                     HWord const   size )
13729 {   13810 {
13730   IRTemp tmp ;   13811   IRTemp tmp ;
13731   IRType tmp___0 ;   13812   IRType tmp___0 ;
13732   IRStmt *tmp___1 ;   13813   IRStmt *tmp___1 ;
13733   IRExpr *tmp___2 ;   13814   IRExpr *tmp___2 ;
13734   IRExpr **tmp___3 ;   13815   IRExpr **tmp___3 ;
13735   void *tmp___4 ;   13816   void *tmp___4 ;
13736   IRDirty *tmp___5 ;   13817   IRDirty *tmp___5 ;
13737   IRStmt *tmp___6 ;   13818   IRStmt *tmp___6 ;
13738     13819  
13739   {   13820   {
13740   tmp___0 = typeOfIRExpr(bb->tyenv, addr_expr);   13821   tmp___0 = typeOfIRExpr(bb->tyenv, addr_expr);
13741   tmp = newIRTemp(bb->tyenv, tmp___0);   13822   tmp = newIRTemp(bb->tyenv, tmp___0);
13742   tmp___1 = IRStmt_WrTmp(tmp, addr_expr);   13823   tmp___1 = IRStmt_WrTmp(tmp, addr_expr);
13743   addStmtToIRSB((IRSB *)bb, tmp___1);   13824   addStmtToIRSB((IRSB *)bb, tmp___1);
13744   addr_expr = IRExpr_RdTmp(tmp);   13825   addr_expr = IRExpr_RdTmp(tmp);
13745   tmp___2 = mkIRExpr_HWord((HWord )size);   13826   tmp___2 = mkIRExpr_HWord((HWord )size);
13746   tmp___3 = mkIRExprVec_2(addr_expr, tmp___2);   13827   tmp___3 = mkIRExprVec_2(addr_expr, tmp___2);
13747   tmp___4 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_mem_load));   13828   tmp___4 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_mem_load));
13748   tmp___5 = unsafeIRDirty_0_N(2, (HChar *)"drd_trace_mem_load", tmp___4, tmp___3);   13829   tmp___5 = unsafeIRDirty_0_N(2, (HChar *)"drd_trace_mem_load", tmp___4, tmp___3);
13749   tmp___6 = IRStmt_Dirty(tmp___5);   13830   tmp___6 = IRStmt_Dirty(tmp___5);
13750   addStmtToIRSB((IRSB *)bb, tmp___6);   13831   addStmtToIRSB((IRSB *)bb, tmp___6);
13751   return (addr_expr);   13832   return (addr_expr);
13752 }   13833 }
13753 }   13834 }
13754 static void instr_trace_mem_store(IRSB * const  bb , IRExpr * const  addr_expr ,   13835 static void instr_trace_mem_store(IRSB * const  bb , IRExpr * const  addr_expr ,
13755                                   IRExpr *data_expr_hi , IRExpr *data_expr_lo )   13836                                   IRExpr *data_expr_hi , IRExpr *data_expr_lo )
13756 {   13837 {
13757   IRType ty_data_expr ;   13838   IRType ty_data_expr ;
13758   HWord size ;   13839   HWord size ;
13759   int tmp ;   13840   int tmp ;
13760   long tmp___0 ;   13841   long tmp___0 ;
13761   IRType tmp___1 ;   13842   IRType tmp___1 ;
13762   int tmp___2 ;   13843   int tmp___2 ;
13763   long tmp___3 ;   13844   long tmp___3 ;
13764   Int tmp___4 ;   13845   Int tmp___4 ;
13765   IRTemp tmp___5 ;   13846   IRTemp tmp___5 ;
13766   IRTemp tmp___6 ;   13847   IRTemp tmp___6 ;
13767   IRExpr *tmp___7 ;   13848   IRExpr *tmp___7 ;
13768   IRStmt *tmp___8 ;   13849   IRStmt *tmp___8 ;
13769   IRTemp tmp___9 ;   13850   IRTemp tmp___9 ;
13770   IRTemp tmp___10 ;   13851   IRTemp tmp___10 ;
13771   IRExpr *tmp___11 ;   13852   IRExpr *tmp___11 ;
13772   IRStmt *tmp___12 ;   13853   IRStmt *tmp___12 ;
13773   IROp widen_op ;   13854   IROp widen_op ;
13774   IRTemp tmp___13 ;   13855   IRTemp tmp___13 ;
13775   int tmp___14 ;   13856   int tmp___14 ;
13776   IRExpr *tmp___15 ;   13857   IRExpr *tmp___15 ;
13777   IRStmt *tmp___16 ;   13858   IRStmt *tmp___16 ;
13778   IRTemp tmp___17 ;   13859   IRTemp tmp___17 ;
13779   long tmp___18 ;   13860   long tmp___18 ;
13780   long tmp___19 ;   13861   long tmp___19 ;
13781   IRExpr *tmp___20 ;   13862   IRExpr *tmp___20 ;
13782   IRStmt *tmp___21 ;   13863   IRStmt *tmp___21 ;
13783   IRExpr *tmp___22 ;   13864   IRExpr *tmp___22 ;
13784   IRStmt *tmp___23 ;   13865   IRStmt *tmp___23 ;
13785   IRExpr *tmp___24 ;   13866   IRExpr *tmp___24 ;
13786   IRExpr *tmp___25 ;   13867   IRExpr *tmp___25 ;
13787   IRExpr *tmp___26 ;   13868   IRExpr *tmp___26 ;
13788   IRExpr **tmp___27 ;   13869   IRExpr **tmp___27 ;
13789   void *tmp___28 ;   13870   void *tmp___28 ;
13790   IRDirty *tmp___29 ;   13871   IRDirty *tmp___29 ;
13791   IRStmt *tmp___30 ;   13872   IRStmt *tmp___30 ;
13792     13873  
13793   {   13874   {
13794   if (sizeof(HWord ) == 4U) {   13875   if (sizeof(HWord ) == 4U) {
13795     tmp = 1;   13876     tmp = 1;
13796   } else   13877   } else
13797   if (sizeof(HWord ) == 8U) {   13878   if (sizeof(HWord ) == 8U) {
13798     tmp = 1;   13879     tmp = 1;
13799   } else {   13880   } else {
13800     tmp = 0;   13881     tmp = 0;
13801   }   13882   }
13802   tmp___0 = __builtin_expect((long )tmp, 1L);   13883   tmp___0 = __builtin_expect((long )tmp, 1L);
13803   if (tmp___0) {   13884   if (tmp___0) {
13804     13885  
13805   } else {   13886   } else {
13806     vgPlain_assert_fail((Bool )0,   13887     vgPlain_assert_fail((Bool )0,
13807                         (Char const   *)"sizeof(HWord) == 4 || sizeof(HWord) == 8",   13888                         (Char const   *)"sizeof(HWord) == 4 || sizeof(HWord) == 8",
13808                         (Char const   *)"drd_load_store.c", 372,   13889                         (Char const   *)"drd_load_store.c", 372,
13809                         (Char const   *)"instr_trace_mem_store", "");   13890                         (Char const   *)"instr_trace_mem_store", "");
13810   }   13891   }
13811   if (! data_expr_hi) {   13892   if (! data_expr_hi) {
13812     tmp___2 = 1;   13893     tmp___2 = 1;
13813   } else {   13894   } else {
13814     tmp___1 = typeOfIRExpr(bb->tyenv, data_expr_hi);   13895     tmp___1 = typeOfIRExpr(bb->tyenv, data_expr_hi);
13815     if ((unsigned int )tmp___1 == 69636U) {   13896     if ((unsigned int )tmp___1 == 69636U) {
13816       tmp___2 = 1;   13897       tmp___2 = 1;
13817     } else {   13898     } else {
13818       tmp___2 = 0;   13899       tmp___2 = 0;
13819     }   13900     }
13820   }   13901   }
13821   tmp___3 = __builtin_expect((long )tmp___2, 1L);   13902   tmp___3 = __builtin_expect((long )tmp___2, 1L);
13822   if (tmp___3) {   13903   if (tmp___3) {
13823     13904  
13824   } else {   13905   } else {
13825     vgPlain_assert_fail((Bool )0,   13906     vgPlain_assert_fail((Bool )0,
13826                         (Char const   *)"!data_expr_hi || typeOfIRExpr(bb->tyenv, data_expr_hi) == Ity_I32",   13907                         (Char const   *)"!data_expr_hi || typeOfIRExpr(bb->tyenv, data_expr_hi) == Ity_I32",
13827                         (Char const   *)"drd_load_store.c", 373,   13908                         (Char const   *)"drd_load_store.c", 373,
13828                         (Char const   *)"instr_trace_mem_store", "");   13909                         (Char const   *)"instr_trace_mem_store", "");
13829   }   13910   }
13830   ty_data_expr = typeOfIRExpr(bb->tyenv, data_expr_lo);   13911   ty_data_expr = typeOfIRExpr(bb->tyenv, data_expr_lo);
13831   tmp___4 = sizeofIRType(ty_data_expr);   13912   tmp___4 = sizeofIRType(ty_data_expr);
13832   size = (HWord )tmp___4;   13913   size = (HWord )tmp___4;
13833   if ((unsigned int )ty_data_expr == 69639U) {   13914   if ((unsigned int )ty_data_expr == 69639U) {
13834     tmp___6 = newIRTemp(bb->tyenv, (IRType )69636);   13915     tmp___6 = newIRTemp(bb->tyenv, (IRType )69636);
13835     tmp___5 = tmp___6;   13916     tmp___5 = tmp___6;
13836     tmp___7 = IRExpr_Unop((IROp )82105, data_expr_lo);   13917     tmp___7 = IRExpr_Unop((IROp )82105, data_expr_lo);
13837     tmp___8 = IRStmt_WrTmp(tmp___5, tmp___7);   13918     tmp___8 = IRStmt_WrTmp(tmp___5, tmp___7);
13838     addStmtToIRSB((IRSB *)bb, tmp___8);   13919     addStmtToIRSB((IRSB *)bb, tmp___8);
13839     data_expr_lo = IRExpr_RdTmp(tmp___5);   13920     data_expr_lo = IRExpr_RdTmp(tmp___5);
13840     ty_data_expr = (IRType )69636;   13921     ty_data_expr = (IRType )69636;
13841   } else   13922   } else
13842   if ((unsigned int )ty_data_expr == 69640U) {   13923   if ((unsigned int )ty_data_expr == 69640U) {
13843     tmp___10 = newIRTemp(bb->tyenv, (IRType )69637);   13924     tmp___10 = newIRTemp(bb->tyenv, (IRType )69637);
13844     tmp___9 = tmp___10;   13925     tmp___9 = tmp___10;
13845     tmp___11 = IRExpr_Unop((IROp )82103, data_expr_lo);   13926     tmp___11 = IRExpr_Unop((IROp )82103, data_expr_lo);
13846     tmp___12 = IRStmt_WrTmp(tmp___9, tmp___11);   13927     tmp___12 = IRStmt_WrTmp(tmp___9, tmp___11);
13847     addStmtToIRSB((IRSB *)bb, tmp___12);   13928     addStmtToIRSB((IRSB *)bb, tmp___12);
13848     data_expr_lo = IRExpr_RdTmp(tmp___9);   13929     data_expr_lo = IRExpr_RdTmp(tmp___9);
13849     ty_data_expr = (IRType )69637;   13930     ty_data_expr = (IRType )69637;
13850   } else {   13931   } else {
13851     13932  
13852   }   13933   }
13853   if (size == (HWord )sizeof(HWord )) {   13934   if (size == (HWord )sizeof(HWord )) {
13854     if ((unsigned int )ty_data_expr == 69636U) {   13935     if ((unsigned int )ty_data_expr == 69636U) {
13855     13936  
13856     } else   13937     } else
13857     if ((unsigned int )ty_data_expr == 69637U) {   13938     if ((unsigned int )ty_data_expr == 69637U) {
13858     13939  
13859     } else {   13940     } else {
13860       goto _L;   13941       goto _L;
13861     }   13942     }
13862   } else {   13943   } else {
13863     _L: /* CIL Label */   13944     _L: /* CIL Label */
13864     if (69633U <= (unsigned int )ty_data_expr) {   13945     if (69633U <= (unsigned int )ty_data_expr) {
13865       if ((unsigned int )ty_data_expr < 69633U + sizeof(u_widen_irop) / sizeof(u_widen_irop[0])) {   13946       if ((unsigned int )ty_data_expr < 69633U + sizeof(u_widen_irop) / sizeof(u_widen_irop[0])) {
13866         widen_op = (IROp )u_widen_irop[(unsigned int )ty_data_expr - 69633U][sizeof(HWord )];   13947         widen_op = (IROp )u_widen_irop[(unsigned int )ty_data_expr - 69633U][sizeof(HWord )];
13867         if (! widen_op) {   13948         if (! widen_op) {
13868           widen_op = (IROp )81920;   13949           widen_op = (IROp )81920;
13869         } else {   13950         } else {
13870     13951  
13871         }   13952         }
13872       } else {   13953       } else {
13873         widen_op = (IROp )81920;   13954         widen_op = (IROp )81920;
13874       }   13955       }
13875     } else {   13956     } else {
13876       widen_op = (IROp )81920;   13957       widen_op = (IROp )81920;
13877     }   13958     }
13878     if ((unsigned int )widen_op != 81920U) {   13959     if ((unsigned int )widen_op != 81920U) {
13879       if (sizeof(HWord ) == 4U) {   13960       if (sizeof(HWord ) == 4U) {
13880         tmp___14 = 69636;   13961         tmp___14 = 69636;
13881       } else {   13962       } else {
13882         tmp___14 = 69637;   13963         tmp___14 = 69637;
13883       }   13964       }
13884       tmp___13 = newIRTemp(bb->tyenv, (IRType )tmp___14);   13965       tmp___13 = newIRTemp(bb->tyenv, (IRType )tmp___14);
13885       tmp___15 = IRExpr_Unop(widen_op, data_expr_lo);   13966       tmp___15 = IRExpr_Unop(widen_op, data_expr_lo);
13886       tmp___16 = IRStmt_WrTmp(tmp___13, tmp___15);   13967       tmp___16 = IRStmt_WrTmp(tmp___13, tmp___15);
13887       addStmtToIRSB((IRSB *)bb, tmp___16);   13968       addStmtToIRSB((IRSB *)bb, tmp___16);
13888       data_expr_lo = IRExpr_RdTmp(tmp___13);   13969       data_expr_lo = IRExpr_RdTmp(tmp___13);
13889     } else   13970     } else
13890     if (size > (HWord )sizeof(HWord )) {   13971     if (size > (HWord )sizeof(HWord )) {
13891       if (! data_expr_hi) {   13972       if (! data_expr_hi) {
13892         if ((unsigned int )ty_data_expr == 69637U) {   13973         if ((unsigned int )ty_data_expr == 69637U) {
13893           tmp___18 = __builtin_expect((long )(! (! (sizeof(HWord ) == 4U))), 1L);   13974           tmp___18 = __builtin_expect((long )(! (! (sizeof(HWord ) == 4U))), 1L);
13894           if (tmp___18) {   13975           if (tmp___18) {
13895     13976  
13896           } else {   13977           } else {
13897             vgPlain_assert_fail((Bool )0, (Char const   *)"sizeof(HWord) == 4",   13978             vgPlain_assert_fail((Bool )0, (Char const   *)"sizeof(HWord) == 4",
13898                                 (Char const   *)"drd_load_store.c", 438,   13979                                 (Char const   *)"drd_load_store.c", 438,
13899                                 (Char const   *)"instr_trace_mem_store", "");   13980                                 (Char const   *)"instr_trace_mem_store", "");
13900           }   13981           }
13901           tmp___19 = __builtin_expect((long )(! (! (size == 8UL))), 1L);   13982           tmp___19 = __builtin_expect((long )(! (! (size == 8UL))), 1L);
13902           if (tmp___19) {   13983           if (tmp___19) {
13903     13984  
13904           } else {   13985           } else {
13905             vgPlain_assert_fail((Bool )0, (Char const   *)"size == 8",   13986             vgPlain_assert_fail((Bool )0, (Char const   *)"size == 8",
13906                                 (Char const   *)"drd_load_store.c", 439,   13987                                 (Char const   *)"drd_load_store.c", 439,
13907                                 (Char const   *)"instr_trace_mem_store", "");   13988                                 (Char const   *)"instr_trace_mem_store", "");
13908           }   13989           }
13909           tmp___17 = newIRTemp(bb->tyenv, (IRType )69636);   13990           tmp___17 = newIRTemp(bb->tyenv, (IRType )69636);
13910           tmp___20 = IRExpr_Unop((IROp )82047, data_expr_lo);   13991           tmp___20 = IRExpr_Unop((IROp )82047, data_expr_lo);
13911           tmp___21 = IRStmt_WrTmp(tmp___17, tmp___20);   13992           tmp___21 = IRStmt_WrTmp(tmp___17, tmp___20);
13912           addStmtToIRSB((IRSB *)bb, tmp___21);   13993           addStmtToIRSB((IRSB *)bb, tmp___21);
13913           data_expr_hi = IRExpr_RdTmp(tmp___17);   13994           data_expr_hi = IRExpr_RdTmp(tmp___17);
13914           tmp___17 = newIRTemp(bb->tyenv, (IRType )69636);   13995           tmp___17 = newIRTemp(bb->tyenv, (IRType )69636);
13915           tmp___22 = IRExpr_Unop((IROp )82046, data_expr_lo);   13996           tmp___22 = IRExpr_Unop((IROp )82046, data_expr_lo);
13916           tmp___23 = IRStmt_WrTmp(tmp___17, tmp___22);   13997           tmp___23 = IRStmt_WrTmp(tmp___17, tmp___22);
13917           addStmtToIRSB((IRSB *)bb, tmp___23);   13998           addStmtToIRSB((IRSB *)bb, tmp___23);
13918           data_expr_lo = IRExpr_RdTmp(tmp___17);   13999           data_expr_lo = IRExpr_RdTmp(tmp___17);
13919         } else {   14000         } else {
13920           data_expr_lo = mkIRExpr_HWord((HWord )0);   14001           data_expr_lo = mkIRExpr_HWord((HWord )0);
13921         }   14002         }
13922       } else {   14003       } else {
13923         data_expr_lo = mkIRExpr_HWord((HWord )0);   14004         data_expr_lo = mkIRExpr_HWord((HWord )0);
13924       }   14005       }
13925     } else {   14006     } else {
13926       data_expr_lo = mkIRExpr_HWord((HWord )0);   14007       data_expr_lo = mkIRExpr_HWord((HWord )0);
13927     }   14008     }
13928   }   14009   }
13929   if (data_expr_hi) {   14010   if (data_expr_hi) {
13930     tmp___25 = data_expr_hi;   14011     tmp___25 = data_expr_hi;
13931   } else {   14012   } else {
13932     tmp___24 = mkIRExpr_HWord((HWord )0);   14013     tmp___24 = mkIRExpr_HWord((HWord )0);
13933     tmp___25 = tmp___24;   14014     tmp___25 = tmp___24;
13934   }   14015   }
13935   tmp___26 = mkIRExpr_HWord(size);   14016   tmp___26 = mkIRExpr_HWord(size);
13936   tmp___27 = mkIRExprVec_4((IRExpr *)addr_expr, tmp___26, tmp___25, data_expr_lo);   14017   tmp___27 = mkIRExprVec_4((IRExpr *)addr_expr, tmp___26, tmp___25, data_expr_lo);
13937   tmp___28 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_mem_store));   14018   tmp___28 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_mem_store));
13938   tmp___29 = unsafeIRDirty_0_N(3, (HChar *)"drd_trace_mem_store", tmp___28,   14019   tmp___29 = unsafeIRDirty_0_N(3, (HChar *)"drd_trace_mem_store", tmp___28,
13939                                tmp___27);   14020                                tmp___27);
13940   tmp___30 = IRStmt_Dirty(tmp___29);   14021   tmp___30 = IRStmt_Dirty(tmp___29);
13941   addStmtToIRSB((IRSB *)bb, tmp___30);   14022   addStmtToIRSB((IRSB *)bb, tmp___30);
13942   return;   14023   return;
13943 }   14024 }
13944 }   14025 }
13945 static void instrument_load(IRSB * const  bb , IRExpr * const  addr_expr ,   14026 static void instrument_load(IRSB * const  bb , IRExpr * const  addr_expr ,
13946                             HWord const   size )   14027                             HWord const   size )
13947 {   14028 {
13948   IRExpr *size_expr ;   14029   IRExpr *size_expr ;
13949   IRExpr **argv ;   14030   IRExpr **argv ;
13950   IRDirty *di ;   14031   IRDirty *di ;
13951   Bool tmp ;   14032   Bool tmp ;
13952   void *tmp___0 ;   14033   void *tmp___0 ;
13953   void *tmp___1 ;   14034   void *tmp___1 ;
13954   void *tmp___2 ;   14035   void *tmp___2 ;
13955   void *tmp___3 ;   14036   void *tmp___3 ;
13956   void *tmp___4 ;   14037   void *tmp___4 ;
13957   IRStmt *tmp___5 ;   14038   IRStmt *tmp___5 ;
13958     14039  
13959   {   14040   {
13960   if (! s_check_stack_accesses) {   14041   if (! s_check_stack_accesses) {
13961     tmp = is_stack_access(bb, addr_expr);   14042     tmp = is_stack_access(bb, addr_expr);
13962     if (tmp) {   14043     if (tmp) {
13963       return;   14044       return;
13964     } else {   14045     } else {
13965     14046  
13966     }   14047     }
13967   } else {   14048   } else {
13968     14049  
13969   }   14050   }
13970   switch (size) {   14051   switch (size) {
13971   case 1UL:   14052   case 1UL:
13972   argv = mkIRExprVec_1((IRExpr *)addr_expr);   14053   argv = mkIRExprVec_1((IRExpr *)addr_expr);
13973   tmp___0 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_load_1));   14054   tmp___0 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_load_1));
13974   di = unsafeIRDirty_0_N(1, (HChar *)"drd_trace_load_1", tmp___0, argv);   14055   di = unsafeIRDirty_0_N(1, (HChar *)"drd_trace_load_1", tmp___0, argv);
13975   break;   14056   break;
13976   case 2UL:   14057   case 2UL:
13977   argv = mkIRExprVec_1((IRExpr *)addr_expr);   14058   argv = mkIRExprVec_1((IRExpr *)addr_expr);
13978   tmp___1 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_load_2));   14059   tmp___1 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_load_2));
13979   di = unsafeIRDirty_0_N(1, (HChar *)"drd_trace_load_2", tmp___1, argv);   14060   di = unsafeIRDirty_0_N(1, (HChar *)"drd_trace_load_2", tmp___1, argv);
13980   break;   14061   break;
13981   case 4UL:   14062   case 4UL:
13982   argv = mkIRExprVec_1((IRExpr *)addr_expr);   14063   argv = mkIRExprVec_1((IRExpr *)addr_expr);
13983   tmp___2 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_load_4));   14064   tmp___2 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_load_4));
13984   di = unsafeIRDirty_0_N(1, (HChar *)"drd_trace_load_4", tmp___2, argv);   14065   di = unsafeIRDirty_0_N(1, (HChar *)"drd_trace_load_4", tmp___2, argv);
13985   break;   14066   break;
13986   case 8UL:   14067   case 8UL:
13987   argv = mkIRExprVec_1((IRExpr *)addr_expr);   14068   argv = mkIRExprVec_1((IRExpr *)addr_expr);
13988   tmp___3 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_load_8));   14069   tmp___3 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_load_8));
13989   di = unsafeIRDirty_0_N(1, (HChar *)"drd_trace_load_8", tmp___3, argv);   14070   di = unsafeIRDirty_0_N(1, (HChar *)"drd_trace_load_8", tmp___3, argv);
13990   break;   14071   break;
13991   default:   14072   default:
13992   size_expr = mkIRExpr_HWord((HWord )size);   14073   size_expr = mkIRExpr_HWord((HWord )size);
13993   argv = mkIRExprVec_2((IRExpr *)addr_expr, size_expr);   14074   argv = mkIRExprVec_2((IRExpr *)addr_expr, size_expr);
13994   tmp___4 = vgPlain_fnptr_to_fnentry((void *)(& vgDrd_trace_load));   14075   tmp___4 = vgPlain_fnptr_to_fnentry((void *)(& vgDrd_trace_load));
13995   di = unsafeIRDirty_0_N(2, (HChar *)"drd_trace_load", tmp___4, argv);   14076   di = unsafeIRDirty_0_N(2, (HChar *)"drd_trace_load", tmp___4, argv);
13996   break;   14077   break;
13997   }   14078   }
13998   tmp___5 = IRStmt_Dirty(di);   14079   tmp___5 = IRStmt_Dirty(di);
13999   addStmtToIRSB((IRSB *)bb, tmp___5);   14080   addStmtToIRSB((IRSB *)bb, tmp___5);
14000   return;   14081   return;
14001 }   14082 }
14002 }   14083 }
14003 static void instrument_store(IRSB * const  bb , IRExpr *addr_expr ,   14084 static void instrument_store(IRSB * const  bb , IRExpr *addr_expr ,
14004                              IRExpr * const  data_expr )   14085                              IRExpr * const  data_expr )
14005 {   14086 {
14006   IRExpr *size_expr ;   14087   IRExpr *size_expr ;
14007   IRExpr **argv ;   14088   IRExpr **argv ;
14008   IRDirty *di ;   14089   IRDirty *di ;
14009   HWord size ;   14090   HWord size ;
14010   IRType tmp ;   14091   IRType tmp ;
14011   Int tmp___0 ;   14092   Int tmp___0 ;
14012   IRTemp tmp___1 ;   14093   IRTemp tmp___1 ;
14013   IRType tmp___2 ;   14094   IRType tmp___2 ;
14014   IRTemp tmp___3 ;   14095   IRTemp tmp___3 ;
14015   IRStmt *tmp___4 ;   14096   IRStmt *tmp___4 ;
14016   Bool tmp___5 ;   14097   Bool tmp___5 ;
14017   int tmp___6 ;   14098   int tmp___6 ;
14018   long tmp___7 ;   14099   long tmp___7 ;
14019   Bool tmp___8 ;   14100   Bool tmp___8 ;
14020   void *tmp___9 ;   14101   void *tmp___9 ;
14021   void *tmp___10 ;   14102   void *tmp___10 ;
14022   void *tmp___11 ;   14103   void *tmp___11 ;
14023   void *tmp___12 ;   14104   void *tmp___12 ;
14024   void *tmp___13 ;   14105   void *tmp___13 ;
14025   IRStmt *tmp___14 ;   14106   IRStmt *tmp___14 ;
14026     14107  
14027   {   14108   {
14028   tmp = typeOfIRExpr(bb->tyenv, (IRExpr *)data_expr);   14109   tmp = typeOfIRExpr(bb->tyenv, (IRExpr *)data_expr);
14029   tmp___0 = sizeofIRType(tmp);   14110   tmp___0 = sizeofIRType(tmp);
14030   size = (HWord )tmp___0;   14111   size = (HWord )tmp___0;
14031   tmp___5 = vgDrd_any_address_is_traced();   14112   tmp___5 = vgDrd_any_address_is_traced();
14032   if (tmp___5) {   14113   if (tmp___5) {
14033     tmp___6 = 1;   14114     tmp___6 = 1;
14034   } else {   14115   } else {
14035     tmp___6 = 0;   14116     tmp___6 = 0;
14036   }   14117   }
14037   tmp___7 = __builtin_expect((long )tmp___6, 0L);   14118   tmp___7 = __builtin_expect((long )tmp___6, 0L);
14038   if (tmp___7) {   14119   if (tmp___7) {
14039     tmp___2 = typeOfIRExpr(bb->tyenv, addr_expr);   14120     tmp___2 = typeOfIRExpr(bb->tyenv, addr_expr);
14040     tmp___3 = newIRTemp(bb->tyenv, tmp___2);   14121     tmp___3 = newIRTemp(bb->tyenv, tmp___2);
14041     tmp___1 = tmp___3;   14122     tmp___1 = tmp___3;
14042     tmp___4 = IRStmt_WrTmp(tmp___1, addr_expr);   14123     tmp___4 = IRStmt_WrTmp(tmp___1, addr_expr);
14043     addStmtToIRSB((IRSB *)bb, tmp___4);   14124     addStmtToIRSB((IRSB *)bb, tmp___4);
14044     addr_expr = IRExpr_RdTmp(tmp___1);   14125     addr_expr = IRExpr_RdTmp(tmp___1);
14045     instr_trace_mem_store(bb, (IRExpr */* const  */)addr_expr,   14126     instr_trace_mem_store(bb, (IRExpr */* const  */)addr_expr,
14046                           (IRExpr *)((void *)0), (IRExpr *)data_expr);   14127                           (IRExpr *)((void *)0), (IRExpr *)data_expr);
14047   } else {   14128   } else {
14048     14129  
14049   }   14130   }
14050   if (! s_check_stack_accesses) {   14131   if (! s_check_stack_accesses) {
14051     tmp___8 = is_stack_access(bb, (IRExpr */* const  */)addr_expr);   14132     tmp___8 = is_stack_access(bb, (IRExpr */* const  */)addr_expr);
14052     if (tmp___8) {   14133     if (tmp___8) {
14053       return;   14134       return;
14054     } else {   14135     } else {
14055     14136  
14056     }   14137     }
14057   } else {   14138   } else {
14058     14139  
14059   }   14140   }
14060   switch (size) {   14141   switch (size) {
14061   case 1UL:   14142   case 1UL:
14062   argv = mkIRExprVec_1(addr_expr);   14143   argv = mkIRExprVec_1(addr_expr);
14063   tmp___9 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_store_1));   14144   tmp___9 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_store_1));
14064   di = unsafeIRDirty_0_N(1, (HChar *)"drd_trace_store_1", tmp___9, argv);   14145   di = unsafeIRDirty_0_N(1, (HChar *)"drd_trace_store_1", tmp___9, argv);
14065   break;   14146   break;
14066   case 2UL:   14147   case 2UL:
14067   argv = mkIRExprVec_1(addr_expr);   14148   argv = mkIRExprVec_1(addr_expr);
14068   tmp___10 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_store_2));   14149   tmp___10 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_store_2));
14069   di = unsafeIRDirty_0_N(1, (HChar *)"drd_trace_store_2", tmp___10, argv);   14150   di = unsafeIRDirty_0_N(1, (HChar *)"drd_trace_store_2", tmp___10, argv);
14070   break;   14151   break;
14071   case 4UL:   14152   case 4UL:
14072   argv = mkIRExprVec_1(addr_expr);   14153   argv = mkIRExprVec_1(addr_expr);
14073   tmp___11 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_store_4));   14154   tmp___11 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_store_4));
14074   di = unsafeIRDirty_0_N(1, (HChar *)"drd_trace_store_4", tmp___11, argv);   14155   di = unsafeIRDirty_0_N(1, (HChar *)"drd_trace_store_4", tmp___11, argv);
14075   break;   14156   break;
14076   case 8UL:   14157   case 8UL:
14077   argv = mkIRExprVec_1(addr_expr);   14158   argv = mkIRExprVec_1(addr_expr);
14078   tmp___12 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_store_8));   14159   tmp___12 = vgPlain_fnptr_to_fnentry((void *)(& drd_trace_store_8));
14079   di = unsafeIRDirty_0_N(1, (HChar *)"drd_trace_store_8", tmp___12, argv);   14160   di = unsafeIRDirty_0_N(1, (HChar *)"drd_trace_store_8", tmp___12, argv);
14080   break;   14161   break;
14081   default:   14162   default:
14082   size_expr = mkIRExpr_HWord(size);   14163   size_expr = mkIRExpr_HWord(size);
14083   argv = mkIRExprVec_2(addr_expr, size_expr);   14164   argv = mkIRExprVec_2(addr_expr, size_expr);
14084   tmp___13 = vgPlain_fnptr_to_fnentry((void *)(& vgDrd_trace_store));   14165   tmp___13 = vgPlain_fnptr_to_fnentry((void *)(& vgDrd_trace_store));
14085   di = unsafeIRDirty_0_N(2, (HChar *)"drd_trace_store", tmp___13, argv);   14166   di = unsafeIRDirty_0_N(2, (HChar *)"drd_trace_store", tmp___13, argv);
14086   break;   14167   break;
14087   }   14168   }
14088   tmp___14 = IRStmt_Dirty(di);   14169   tmp___14 = IRStmt_Dirty(di);
14089   addStmtToIRSB((IRSB *)bb, tmp___14);   14170   addStmtToIRSB((IRSB *)bb, tmp___14);
14090   return;   14171   return;
14091 }   14172 }
14092 }   14173 }
14093 IRSB *vgDrd_instrument(VgCallbackClosure * const  closure ,   14174 IRSB *vgDrd_instrument(VgCallbackClosure * const  closure ,
14094                        IRSB * const  bb_in , VexGuestLayout * const  layout ,   14175                        IRSB * const  bb_in , VexGuestLayout * const  layout ,
14095                        VexGuestExtents * const  vge , IRType const   gWordTy ,   14176                        VexGuestExtents * const  vge , IRType const   gWordTy ,
14096                        IRType const   hWordTy )   14177                        IRType const   hWordTy )
14097 {   14178 {
14098   IRDirty *di ;   14179   IRDirty *di ;
14099   Int i ;   14180   Int i ;
14100   IRSB *bb ;   14181   IRSB *bb ;
14101   IRExpr **argv ;   14182   IRExpr **argv ;
14102   Bool instrument ;   14183   Bool instrument ;
14103   IRStmt *st ;   14184   IRStmt *st ;
14104   long tmp ;   14185   long tmp ;
14105   Bool tmp___0 ;   14186   Bool tmp___0 ;
14106   int tmp___1 ;   14187   int tmp___1 ;
14107   long tmp___2 ;   14188   long tmp___2 ;
14108   VgSectKind tmp___3 ;   14189   VgSectKind tmp___3 ;
14109   long tmp___4 ;   14190   long tmp___4 ;
14110   IRExpr const   *data ;   14191   IRExpr const   *data ;
14111   IRExpr *addr_expr ;   14192   IRExpr *addr_expr ;
14112   Int tmp___5 ;   14193   Int tmp___5 ;
14113   Bool tmp___6 ;   14194   Bool tmp___6 ;
14114   int tmp___7 ;   14195   int tmp___7 ;
14115   long tmp___8 ;   14196   long tmp___8 ;
14116   Int tmp___9 ;   14197   Int tmp___9 ;
14117   IRDirty *d ;   14198   IRDirty *d ;
14118   IREffect mFx ;   14199   IREffect mFx ;
14119   long tmp___10 ;   14200   long tmp___10 ;
14120   long tmp___11 ;   14201   long tmp___11 ;
14121   IRExpr *tmp___12 ;   14202   IRExpr *tmp___12 ;
14122   void *tmp___13 ;   14203   void *tmp___13 ;
14123   IRStmt *tmp___14 ;   14204   IRStmt *tmp___14 ;
14124   void *tmp___15 ;   14205   void *tmp___15 ;
14125   IRStmt *tmp___16 ;   14206   IRStmt *tmp___16 ;
14126   long tmp___17 ;   14207   long tmp___17 ;
14127   Int dataSize ;   14208   Int dataSize ;
14128   IRCAS *cas ;   14209   IRCAS *cas ;
14129   long tmp___18 ;   14210   long tmp___18 ;
14130   long tmp___19 ;   14211   long tmp___19 ;
14131   IRType tmp___20 ;   14212   IRType tmp___20 ;
14132   Bool tmp___21 ;   14213   Bool tmp___21 ;
14133   int tmp___22 ;   14214   int tmp___22 ;
14134   long tmp___23 ;   14215   long tmp___23 ;
14135   IRType dataTy ;   14216   IRType dataTy ;
14136   IRExpr *addr_expr___0 ;   14217   IRExpr *addr_expr___0 ;
14137   Int tmp___24 ;   14218   Int tmp___24 ;
14138   Bool tmp___25 ;   14219   Bool tmp___25 ;
14139   int tmp___26 ;   14220   int tmp___26 ;
14140   long tmp___27 ;   14221   long tmp___27 ;
14141   Int tmp___28 ;   14222   Int tmp___28 ;
14142   long tmp___29 ;   14223   long tmp___29 ;
14143     14224  
14144   {   14225   {
14145   instrument = (Bool )1;   14226   instrument = (Bool )1;
14146   bb = emptyIRSB();   14227   bb = emptyIRSB();
14147   bb->tyenv = deepCopyIRTypeEnv(bb_in->tyenv);   14228   bb->tyenv = deepCopyIRTypeEnv(bb_in->tyenv);
14148   bb->next = deepCopyIRExpr(bb_in->next);   14229   bb->next = deepCopyIRExpr(bb_in->next);
14149   bb->jumpkind = bb_in->jumpkind;   14230   bb->jumpkind = bb_in->jumpkind;
14150   i = 0;   14231   i = 0;
14151   while (i < bb_in->stmts_used) {   14232   while (i < bb_in->stmts_used) {
14152     st = *(bb_in->stmts + i);   14233     st = *(bb_in->stmts + i);
14153     tmp = __builtin_expect((long )(! (! st)), 1L);   14234     tmp = __builtin_expect((long )(! (! st)), 1L);
14154     if (tmp) {   14235     if (tmp) {
14155     14236  
14156     } else {   14237     } else {
14157       vgPlain_assert_fail((Bool )0, (Char const   *)"st",   14238       vgPlain_assert_fail((Bool )0, (Char const   *)"st",
14158                           (Char const   *)"drd_load_store.c", 599,   14239                           (Char const   *)"drd_load_store.c", 599,
14159                           (Char const   *)"vgDrd_instrument", "");   14240                           (Char const   *)"vgDrd_instrument", "");
14160     }   14241     }
14161     tmp___0 = isFlatIRStmt(st);   14242     tmp___0 = isFlatIRStmt(st);
14162     if (tmp___0) {   14243     if (tmp___0) {
14163       tmp___1 = 1;   14244       tmp___1 = 1;
14164     } else {   14245     } else {
14165       tmp___1 = 0;   14246       tmp___1 = 0;
14166     }   14247     }
14167     tmp___2 = __builtin_expect((long )tmp___1, 1L);   14248     tmp___2 = __builtin_expect((long )tmp___1, 1L);
14168     if (tmp___2) {   14249     if (tmp___2) {
14169     14250  
14170     } else {   14251     } else {
14171       vgPlain_assert_fail((Bool )0, (Char const   *)"isFlatIRStmt(st)",   14252       vgPlain_assert_fail((Bool )0, (Char const   *)"isFlatIRStmt(st)",
14172                           (Char const   *)"drd_load_store.c", 600,   14253                           (Char const   *)"drd_load_store.c", 600,
14173                           (Char const   *)"vgDrd_instrument", "");   14254                           (Char const   *)"vgDrd_instrument", "");
14174     }   14255     }
14175     switch ((unsigned int )st->tag) {   14256     switch ((unsigned int )st->tag) {
14176     case 102401U:   14257     case 102401U:
14177     tmp___3 = vgPlain_DebugInfo_sect_kind((UChar *)((void *)0), (SizeT )0,   14258     tmp___3 = vgPlain_DebugInfo_sect_kind((UChar *)((void *)0), (SizeT )0,
14178                                           (Addr )st->Ist.IMark.addr);   14259                                           (Addr )st->Ist.IMark.addr);
14179     instrument = (Bool )((unsigned int )tmp___3 != 5U);   14260     instrument = (Bool )((unsigned int )tmp___3 != 5U);
14180     addStmtToIRSB(bb, st);   14261     addStmtToIRSB(bb, st);
14181     break;   14262     break;
14182     case 102410U:   14263     case 102410U:
14183     switch ((unsigned int )st->Ist.MBE.event) {   14264     switch ((unsigned int )st->Ist.MBE.event) {
14184     case 98304U:   14265     case 98304U:
14185     break;   14266     break;
14186     default:   14267     default:
14187     tmp___4 = __builtin_expect(0L, 1L);   14268     tmp___4 = __builtin_expect(0L, 1L);
14188     if (tmp___4) {   14269     if (tmp___4) {
14189     14270  
14190     } else {   14271     } else {
14191       vgPlain_assert_fail((Bool )0, (Char const   *)"0",   14272       vgPlain_assert_fail((Bool )0, (Char const   *)"0",
14192                           (Char const   *)"drd_load_store.c", 622,   14273                           (Char const   *)"drd_load_store.c", 622,
14193                           (Char const   *)"vgDrd_instrument", "");   14274                           (Char const   *)"vgDrd_instrument", "");
14194     }   14275     }
14195     }   14276     }
14196     addStmtToIRSB(bb, st);   14277     addStmtToIRSB(bb, st);
14197     break;   14278     break;
14198     case 102406U:   14279     case 102406U:
14199     if (instrument) {   14280     if (instrument) {
14200       instrument_store((IRSB */* const  */)bb, st->Ist.Store.addr,   14281       instrument_store((IRSB */* const  */)bb, st->Ist.Store.addr,
14201                        (IRExpr */* const  */)st->Ist.Store.data);   14282                        (IRExpr */* const  */)st->Ist.Store.data);
14202     } else {   14283     } else {
14203     14284  
14204     }   14285     }
14205     addStmtToIRSB(bb, st);   14286     addStmtToIRSB(bb, st);
14206     break;   14287     break;
14207     case 102405U:   14288     case 102405U:
14208     if (instrument) {   14289     if (instrument) {
14209       data = (IRExpr const   *)st->Ist.WrTmp.data;   14290       data = (IRExpr const   *)st->Ist.WrTmp.data;
14210       addr_expr = (IRExpr *)data->Iex.Load.addr;   14291       addr_expr = (IRExpr *)data->Iex.Load.addr;
14211       if ((unsigned int const   )data->tag == 86024U) {   14292       if ((unsigned int const   )data->tag == 86024U) {
14212         tmp___6 = vgDrd_any_address_is_traced();   14293         tmp___6 = vgDrd_any_address_is_traced();
14213         if (tmp___6) {   14294         if (tmp___6) {
14214           tmp___7 = 1;   14295           tmp___7 = 1;
14215         } else {   14296         } else {
14216           tmp___7 = 0;   14297           tmp___7 = 0;
14217         }   14298         }
14218         tmp___8 = __builtin_expect((long )tmp___7, 0L);   14299         tmp___8 = __builtin_expect((long )tmp___7, 0L);
14219         if (tmp___8) {   14300         if (tmp___8) {
14220           tmp___5 = sizeofIRType((IRType )data->Iex.Load.ty);   14301           tmp___5 = sizeofIRType((IRType )data->Iex.Load.ty);
14221           addr_expr = instr_trace_mem_load((IRSB */* const  */)bb, addr_expr,   14302           addr_expr = instr_trace_mem_load((IRSB */* const  */)bb, addr_expr,
14222                                            (HWord const   )tmp___5);   14303                                            (HWord const   )tmp___5);
14223         } else {   14304         } else {
14224     14305  
14225         }   14306         }
14226         tmp___9 = sizeofIRType((IRType )data->Iex.Load.ty);   14307         tmp___9 = sizeofIRType((IRType )data->Iex.Load.ty);
14227         instrument_load((IRSB */* const  */)bb, data->Iex.Load.addr,   14308         instrument_load((IRSB */* const  */)bb, data->Iex.Load.addr,
14228                         (HWord const   )tmp___9);   14309                         (HWord const   )tmp___9);
14229       } else {   14310       } else {
14230     14311  
14231       }   14312       }
14232     } else {   14313     } else {
14233     14314  
14234     }   14315     }
14235     addStmtToIRSB(bb, st);   14316     addStmtToIRSB(bb, st);
14236     break;   14317     break;
14237     case 102409U:   14318     case 102409U:
14238     if (instrument) {   14319     if (instrument) {
14239       d = st->Ist.Dirty.details;   14320       d = st->Ist.Dirty.details;
14240       mFx = d->mFx;   14321       mFx = d->mFx;
14241       switch ((unsigned int )mFx) {   14322       switch ((unsigned int )mFx) {
14242       case 94208U:   14323       case 94208U:
14243       break;   14324       break;
14244       case 94211U:   14325       case 94211U:
14245       case 94210U:   14326       case 94210U:
14246       case 94209U:   14327       case 94209U:
14247       tmp___10 = __builtin_expect((long )(! (! d->mAddr)), 1L);   14328       tmp___10 = __builtin_expect((long )(! (! d->mAddr)), 1L);
14248       if (tmp___10) {   14329       if (tmp___10) {
14249     14330  
14250       } else {   14331       } else {
14251         vgPlain_assert_fail((Bool )0, (Char const   *)"d->mAddr",   14332         vgPlain_assert_fail((Bool )0, (Char const   *)"d->mAddr",
14252                             (Char const   *)"drd_load_store.c", 659,   14333                             (Char const   *)"drd_load_store.c", 659,
14253                             (Char const   *)"vgDrd_instrument", "");   14334                             (Char const   *)"vgDrd_instrument", "");
14254       }   14335       }
14255       tmp___11 = __builtin_expect((long )(! (! (d->mSize > 0))), 1L);   14336       tmp___11 = __builtin_expect((long )(! (! (d->mSize > 0))), 1L);
14256       if (tmp___11) {   14337       if (tmp___11) {
14257     14338  
14258       } else {   14339       } else {
14259         vgPlain_assert_fail((Bool )0, (Char const   *)"d->mSize > 0",   14340         vgPlain_assert_fail((Bool )0, (Char const   *)"d->mSize > 0",
14260                             (Char const   *)"drd_load_store.c", 660,   14341                             (Char const   *)"drd_load_store.c", 660,
14261                             (Char const   *)"vgDrd_instrument", "");   14342                             (Char const   *)"vgDrd_instrument", "");
14262       }   14343       }
14263       tmp___12 = mkIRExpr_HWord((HWord )d->mSize);   14344       tmp___12 = mkIRExpr_HWord((HWord )d->mSize);
14264       argv = mkIRExprVec_2(d->mAddr, tmp___12);   14345       argv = mkIRExprVec_2(d->mAddr, tmp___12);
14265       if ((unsigned int )mFx == 94209U) {   14346       if ((unsigned int )mFx == 94209U) {
14266         tmp___13 = vgPlain_fnptr_to_fnentry((void *)(& vgDrd_trace_load));   14347         tmp___13 = vgPlain_fnptr_to_fnentry((void *)(& vgDrd_trace_load));
14267         di = unsafeIRDirty_0_N(2, (HChar *)"drd_trace_load", tmp___13, argv);   14348         di = unsafeIRDirty_0_N(2, (HChar *)"drd_trace_load", tmp___13, argv);
14268         tmp___14 = IRStmt_Dirty(di);   14349         tmp___14 = IRStmt_Dirty(di);
14269         addStmtToIRSB(bb, tmp___14);   14350         addStmtToIRSB(bb, tmp___14);
14270       } else   14351       } else
14271       if ((unsigned int )mFx == 94211U) {   14352       if ((unsigned int )mFx == 94211U) {
14272         tmp___13 = vgPlain_fnptr_to_fnentry((void *)(& vgDrd_trace_load));   14353         tmp___13 = vgPlain_fnptr_to_fnentry((void *)(& vgDrd_trace_load));
14273         di = unsafeIRDirty_0_N(2, (HChar *)"drd_trace_load", tmp___13, argv);   14354         di = unsafeIRDirty_0_N(2, (HChar *)"drd_trace_load", tmp___13, argv);
14274         tmp___14 = IRStmt_Dirty(di);   14355         tmp___14 = IRStmt_Dirty(di);
14275         addStmtToIRSB(bb, tmp___14);   14356         addStmtToIRSB(bb, tmp___14);
14276       } else {   14357       } else {
14277     14358  
14278       }   14359       }
14279       if ((unsigned int )mFx == 94210U) {   14360       if ((unsigned int )mFx == 94210U) {
14280         tmp___15 = vgPlain_fnptr_to_fnentry((void *)(& vgDrd_trace_store));   14361         tmp___15 = vgPlain_fnptr_to_fnentry((void *)(& vgDrd_trace_store));
14281         di = unsafeIRDirty_0_N(2, (HChar *)"drd_trace_store", tmp___15, argv);   14362         di = unsafeIRDirty_0_N(2, (HChar *)"drd_trace_store", tmp___15, argv);
14282         tmp___16 = IRStmt_Dirty(di);   14363         tmp___16 = IRStmt_Dirty(di);
14283         addStmtToIRSB(bb, tmp___16);   14364         addStmtToIRSB(bb, tmp___16);
14284       } else   14365       } else
14285       if ((unsigned int )mFx == 94211U) {   14366       if ((unsigned int )mFx == 94211U) {
14286         tmp___15 = vgPlain_fnptr_to_fnentry((void *)(& vgDrd_trace_store));   14367         tmp___15 = vgPlain_fnptr_to_fnentry((void *)(& vgDrd_trace_store));
14287         di = unsafeIRDirty_0_N(2, (HChar *)"drd_trace_store", tmp___15, argv);   14368         di = unsafeIRDirty_0_N(2, (HChar *)"drd_trace_store", tmp___15, argv);
14288         tmp___16 = IRStmt_Dirty(di);   14369         tmp___16 = IRStmt_Dirty(di);
14289         addStmtToIRSB(bb, tmp___16);   14370         addStmtToIRSB(bb, tmp___16);
14290       } else {   14371       } else {
14291     14372  
14292       }   14373       }
14293       break;   14374       break;
14294       default:   14375       default:
14295       tmp___17 = __builtin_expect(0L, 1L);   14376       tmp___17 = __builtin_expect(0L, 1L);
14296       if (tmp___17) {   14377       if (tmp___17) {
14297     14378  
14298       } else {   14379       } else {
14299         vgPlain_assert_fail((Bool )0, (Char const   *)"0",   14380         vgPlain_assert_fail((Bool )0, (Char const   *)"0",
14300                             (Char const   *)"drd_load_store.c", 681,   14381                             (Char const   *)"drd_load_store.c", 681,
14301                             (Char const   *)"vgDrd_instrument", "");   14382                             (Char const   *)"vgDrd_instrument", "");
14302       }   14383       }
14303       }   14384       }
14304     } else {   14385     } else {
14305     14386  
14306     }   14387     }
14307     addStmtToIRSB(bb, st);   14388     addStmtToIRSB(bb, st);
14308     break;   14389     break;
14309     case 102407U:   14390     case 102407U:
14310     if (instrument) {   14391     if (instrument) {
14311       cas = st->Ist.CAS.details;   14392       cas = st->Ist.CAS.details;
14312       tmp___18 = __builtin_expect((long )(! (! ((unsigned int )cas->addr != (unsigned int )((void *)0)))),   14393       tmp___18 = __builtin_expect((long )(! (! ((unsigned int )cas->addr != (unsigned int )((void *)0)))),
14313                                   1L);   14394                                   1L);
14314       if (tmp___18) {   14395       if (tmp___18) {
14315     14396  
14316       } else {   14397       } else {
14317         vgPlain_assert_fail((Bool )0, (Char const   *)"cas->addr != NULL",   14398         vgPlain_assert_fail((Bool )0, (Char const   *)"cas->addr != NULL",
14318                             (Char const   *)"drd_load_store.c", 700,   14399                             (Char const   *)"drd_load_store.c", 700,
14319                             (Char const   *)"vgDrd_instrument", "");   14400                             (Char const   *)"vgDrd_instrument", "");
14320       }   14401       }
14321       tmp___19 = __builtin_expect((long )(! (! ((unsigned int )cas->dataLo != (unsigned int )((void *)0)))),   14402       tmp___19 = __builtin_expect((long )(! (! ((unsigned int )cas->dataLo != (unsigned int )((void *)0)))),
14322                                   1L);   14403                                   1L);
14323       if (tmp___19) {   14404       if (tmp___19) {
14324     14405  
14325       } else {   14406       } else {
14326         vgPlain_assert_fail((Bool )0, (Char const   *)"cas->dataLo != NULL",   14407         vgPlain_assert_fail((Bool )0, (Char const   *)"cas->dataLo != NULL",
14327                             (Char const   *)"drd_load_store.c", 701,   14408                             (Char const   *)"drd_load_store.c", 701,
14328                             (Char const   *)"vgDrd_instrument", "");   14409                             (Char const   *)"vgDrd_instrument", "");
14329       }   14410       }
14330       tmp___20 = typeOfIRExpr(bb->tyenv, cas->dataLo);   14411       tmp___20 = typeOfIRExpr(bb->tyenv, cas->dataLo);
14331       dataSize = sizeofIRType(tmp___20);   14412       dataSize = sizeofIRType(tmp___20);
14332       if ((unsigned int )cas->dataHi != (unsigned int )((void *)0)) {   14413       if ((unsigned int )cas->dataHi != (unsigned int )((void *)0)) {
14333         dataSize *= 2;   14414         dataSize *= 2;
14334       } else {   14415       } else {
14335     14416  
14336       }   14417       }
14337       tmp___21 = vgDrd_any_address_is_traced();   14418       tmp___21 = vgDrd_any_address_is_traced();
14338       if (tmp___21) {   14419       if (tmp___21) {
14339         tmp___22 = 1;   14420         tmp___22 = 1;
14340       } else {   14421       } else {
14341         tmp___22 = 0;   14422         tmp___22 = 0;
14342       }   14423       }
14343       tmp___23 = __builtin_expect((long )tmp___22, 0L);   14424       tmp___23 = __builtin_expect((long )tmp___22, 0L);
14344       if (tmp___23) {   14425       if (tmp___23) {
14345         instr_trace_mem_store((IRSB */* const  */)bb,   14426         instr_trace_mem_store((IRSB */* const  */)bb,
14346                               (IRExpr */* const  */)cas->addr, cas->dataHi,   14427                               (IRExpr */* const  */)cas->addr, cas->dataHi,
14347                               cas->dataLo);   14428                               cas->dataLo);
14348       } else {   14429       } else {
14349     14430  
14350       }   14431       }
14351       instrument_load((IRSB */* const  */)bb, (IRExpr */* const  */)cas->addr,   14432       instrument_load((IRSB */* const  */)bb, (IRExpr */* const  */)cas->addr,
14352                       (HWord const   )dataSize);   14433                       (HWord const   )dataSize);
14353     } else {   14434     } else {
14354     14435  
14355     }   14436     }
14356     addStmtToIRSB(bb, st);   14437     addStmtToIRSB(bb, st);
14357     break;   14438     break;
14358     case 102408U:   14439     case 102408U:
14359     if ((unsigned int )st->Ist.LLSC.storedata == (unsigned int )((void *)0)) {   14440     if ((unsigned int )st->Ist.LLSC.storedata == (unsigned int )((void *)0)) {
14360       dataTy = typeOfIRTemp(bb_in->tyenv, st->Ist.LLSC.result);   14441       dataTy = typeOfIRTemp(bb_in->tyenv, st->Ist.LLSC.result);
14361       if (instrument) {   14442       if (instrument) {
14362         addr_expr___0 = st->Ist.LLSC.addr;   14443         addr_expr___0 = st->Ist.LLSC.addr;
14363         tmp___25 = vgDrd_any_address_is_traced();   14444         tmp___25 = vgDrd_any_address_is_traced();
14364         if (tmp___25) {   14445         if (tmp___25) {
14365           tmp___26 = 1;   14446           tmp___26 = 1;
14366         } else {   14447         } else {
14367           tmp___26 = 0;   14448           tmp___26 = 0;
14368         }   14449         }
14369         tmp___27 = __builtin_expect((long )tmp___26, 0L);   14450         tmp___27 = __builtin_expect((long )tmp___26, 0L);
14370         if (tmp___27) {   14451         if (tmp___27) {
14371           tmp___24 = sizeofIRType(dataTy);   14452           tmp___24 = sizeofIRType(dataTy);
14372           addr_expr___0 = instr_trace_mem_load((IRSB */* const  */)bb,   14453           addr_expr___0 = instr_trace_mem_load((IRSB */* const  */)bb,
14373                                                addr_expr___0,   14454                                                addr_expr___0,
14374                                                (HWord const   )tmp___24);   14455                                                (HWord const   )tmp___24);
14375         } else {   14456         } else {
14376     14457  
14377         }   14458         }
14378         tmp___28 = sizeofIRType(dataTy);   14459         tmp___28 = sizeofIRType(dataTy);
14379         instrument_load((IRSB */* const  */)bb,   14460         instrument_load((IRSB */* const  */)bb,
14380                         (IRExpr */* const  */)addr_expr___0,   14461                         (IRExpr */* const  */)addr_expr___0,
14381                         (HWord const   )tmp___28);   14462                         (HWord const   )tmp___28);
14382       } else {   14463       } else {
14383     14464  
14384       }   14465       }
14385     } else {   14466     } else {
14386       instr_trace_mem_store((IRSB */* const  */)bb,   14467       instr_trace_mem_store((IRSB */* const  */)bb,
14387                             (IRExpr */* const  */)st->Ist.LLSC.addr,   14468                             (IRExpr */* const  */)st->Ist.LLSC.addr,
14388                             (IRExpr *)((void *)0), st->Ist.LLSC.storedata);   14469                             (IRExpr *)((void *)0), st->Ist.LLSC.storedata);
14389     }   14470     }
14390     addStmtToIRSB(bb, st);   14471     addStmtToIRSB(bb, st);
14391     break;   14472     break;
14392     case 102411U:   14473     case 102411U:
14393     case 102404U:   14474     case 102404U:
14394     case 102403U:   14475     case 102403U:
14395     case 102402U:   14476     case 102402U:
14396     case 102400U:   14477     case 102400U:
14397     addStmtToIRSB(bb, st);   14478     addStmtToIRSB(bb, st);
14398     break;   14479     break;
14399     default:   14480     default:
14400     ppIRStmt(st);   14481     ppIRStmt(st);
14401     tmp___29 = __builtin_expect(0L, 1L);   14482     tmp___29 = __builtin_expect(0L, 1L);
14402     if (tmp___29) {   14483     if (tmp___29) {
14403     14484  
14404     } else {   14485     } else {
14405       vgPlain_assert_fail((Bool )0, (Char const   *)"0",   14486       vgPlain_assert_fail((Bool )0, (Char const   *)"0",
14406                           (Char const   *)"drd_load_store.c", 752,   14487                           (Char const   *)"drd_load_store.c", 752,
14407                           (Char const   *)"vgDrd_instrument", "");   14488                           (Char const   *)"vgDrd_instrument", "");
14408     }   14489     }
14409     }   14490     }
14410     i ++;   14491     i ++;
14411   }   14492   }
14412   return (bb);   14493   return (bb);
14413 }   14494 }
14414 }   14495 }